{
  "components": {
    "schemas": {
      "AcknowledgeResponse": {
        "properties": {
          "acknowledged": {
            "title": "Acknowledged",
            "type": "boolean"
          },
          "alert_id": {
            "title": "Alert Id",
            "type": "string"
          }
        },
        "required": [
          "acknowledged",
          "alert_id"
        ],
        "title": "AcknowledgeResponse",
        "type": "object"
      },
      "ActionListResponse": {
        "properties": {
          "actions": {
            "items": {
              "type": "object"
            },
            "title": "Actions",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "actions",
          "total"
        ],
        "title": "ActionListResponse",
        "type": "object"
      },
      "ActionResponse": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "action_id": {
            "title": "Action Id",
            "type": "string"
          },
          "detail": {
            "title": "Detail",
            "type": "object"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "action_id",
          "instance_id",
          "action",
          "status",
          "message"
        ],
        "title": "ActionResponse",
        "type": "object"
      },
      "ActionSchema": {
        "properties": {
          "config": {
            "description": "Action-specific configuration",
            "title": "Config",
            "type": "object"
          },
          "type": {
            "description": "Action type",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "ActionSchema",
        "type": "object"
      },
      "ActiveCallOut": {
        "properties": {
          "call_id": {
            "title": "Call Id",
            "type": "string"
          },
          "caller_phone": {
            "title": "Caller Phone",
            "type": "string"
          },
          "duration_seconds": {
            "title": "Duration Seconds",
            "type": "number"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "transcript_turns": {
            "title": "Transcript Turns",
            "type": "integer"
          }
        },
        "required": [
          "call_id",
          "caller_phone",
          "state",
          "duration_seconds",
          "transcript_turns"
        ],
        "title": "ActiveCallOut",
        "type": "object"
      },
      "AdvanceStageRequest": {
        "properties": {
          "completed_stage_slug": {
            "title": "Completed Stage Slug",
            "type": "string"
          },
          "person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Person Id"
          },
          "submission_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submission Id"
          }
        },
        "required": [
          "completed_stage_slug"
        ],
        "title": "AdvanceStageRequest",
        "type": "object"
      },
      "AgentHostNodeCreate": {
        "properties": {
          "capacity": {
            "default": 50,
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Capacity",
            "type": "integer"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "AgentHostNodeCreate",
        "type": "object"
      },
      "AgentHostNodeOut": {
        "properties": {
          "capacity": {
            "title": "Capacity",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current_load": {
            "title": "Current Load",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "instance_id",
          "capacity",
          "current_load",
          "status",
          "created_at"
        ],
        "title": "AgentHostNodeOut",
        "type": "object"
      },
      "AgentHostNodeUpdate": {
        "properties": {
          "capacity": {
            "anyOf": [
              {
                "maximum": 500.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Capacity"
          },
          "status": {
            "anyOf": [
              {
                "pattern": "^(active|draining|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "AgentHostNodeUpdate",
        "type": "object"
      },
      "AiAssistRequest": {
        "properties": {
          "description": {
            "maxLength": 2000,
            "minLength": 10,
            "title": "Description",
            "type": "string"
          }
        },
        "required": [
          "description"
        ],
        "title": "AiAssistRequest",
        "type": "object"
      },
      "AiAssistResponse": {
        "properties": {
          "channel_types": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Channel Types",
            "type": "array"
          },
          "connection_requirements": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Connection Requirements",
            "type": "array"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "model_policy": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Policy"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "skills": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          }
        },
        "required": [
          "name"
        ],
        "title": "AiAssistResponse",
        "type": "object"
      },
      "AlertListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AlertOut"
            },
            "title": "Items",
            "type": "array"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "AlertListResponse",
        "type": "object"
      },
      "AlertOut": {
        "properties": {
          "acknowledged_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acknowledged At"
          },
          "acknowledged_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acknowledged By"
          },
          "alert_type": {
            "title": "Alert Type",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "detail": {
            "title": "Detail",
            "type": "object"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "resolved_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "alert_type",
          "severity",
          "title",
          "detail",
          "created_at"
        ],
        "title": "AlertOut",
        "type": "object"
      },
      "AlertSummaryResponse": {
        "properties": {
          "critical": {
            "default": 0,
            "title": "Critical",
            "type": "integer"
          },
          "info": {
            "default": 0,
            "title": "Info",
            "type": "integer"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          },
          "warning": {
            "default": 0,
            "title": "Warning",
            "type": "integer"
          }
        },
        "title": "AlertSummaryResponse",
        "type": "object"
      },
      "AnalyticsSummaryOut": {
        "properties": {
          "daily_views": {
            "items": {
              "type": "object"
            },
            "title": "Daily Views",
            "type": "array"
          },
          "device_breakdown": {
            "title": "Device Breakdown",
            "type": "object"
          },
          "period_days": {
            "title": "Period Days",
            "type": "integer"
          },
          "top_pages": {
            "items": {
              "type": "object"
            },
            "title": "Top Pages",
            "type": "array"
          },
          "total_views": {
            "title": "Total Views",
            "type": "integer"
          },
          "unique_sessions": {
            "title": "Unique Sessions",
            "type": "integer"
          }
        },
        "required": [
          "period_days",
          "total_views",
          "unique_sessions",
          "top_pages"
        ],
        "title": "AnalyticsSummaryOut",
        "type": "object"
      },
      "AnalyticsTrackRequest": {
        "properties": {
          "device_type": {
            "anyOf": [
              {
                "pattern": "^(desktop|tablet|mobile)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Device Type"
          },
          "page_path": {
            "maxLength": 2048,
            "title": "Page Path",
            "type": "string"
          },
          "referrer": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referrer"
          },
          "screen_width": {
            "anyOf": [
              {
                "maximum": 10000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Screen Width"
          },
          "session_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "site_id": {
            "format": "uuid",
            "title": "Site Id",
            "type": "string"
          }
        },
        "required": [
          "site_id",
          "page_path"
        ],
        "title": "AnalyticsTrackRequest",
        "type": "object"
      },
      "ApiKeyContextResponse": {
        "description": "Bounded metadata for MCP-side scope enforcement.\n\nMirrors what `require_scope()` reads from `request.state` so the\nMCP server can implement the same exact-match / wildcard-reject /\nlegacy-bridge semantics without re-fetching the key row.",
        "properties": {
          "api_key_id": {
            "title": "Api Key Id",
            "type": "string"
          },
          "customer_id": {
            "title": "Customer Id",
            "type": "string"
          },
          "hash_version": {
            "title": "Hash Version",
            "type": "string"
          },
          "needs_reissue": {
            "title": "Needs Reissue",
            "type": "boolean"
          },
          "rate_limit_per_hour": {
            "title": "Rate Limit Per Hour",
            "type": "integer"
          },
          "rate_limit_per_minute": {
            "title": "Rate Limit Per Minute",
            "type": "integer"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "api_key_id",
          "scopes",
          "hash_version",
          "needs_reissue",
          "user_id",
          "tenant_id",
          "customer_id",
          "rate_limit_per_minute",
          "rate_limit_per_hour"
        ],
        "title": "ApiKeyContextResponse",
        "type": "object"
      },
      "ApiKeyOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "key_type": {
            "title": "Key Type",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "required": [
          "id",
          "name",
          "key_prefix",
          "key_type",
          "is_active",
          "created_at"
        ],
        "title": "ApiKeyOut",
        "type": "object"
      },
      "AppOut": {
        "properties": {
          "categories": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Categories",
            "type": "array"
          },
          "description": {
            "default": "",
            "title": "Description",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "logo": {
            "default": "",
            "title": "Logo",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "provider_slug": {
            "title": "Provider Slug",
            "type": "string"
          }
        },
        "required": [
          "name",
          "key",
          "provider_slug"
        ],
        "title": "AppOut",
        "type": "object"
      },
      "ApplicationOut": {
        "properties": {
          "applied_at": {
            "format": "date-time",
            "title": "Applied At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "template_id": {
            "format": "uuid",
            "title": "Template Id",
            "type": "string"
          },
          "template_version": {
            "title": "Template Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "template_id",
          "customer_id",
          "template_version",
          "applied_at"
        ],
        "title": "ApplicationOut",
        "type": "object"
      },
      "ApplyAllUpdatesResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "runtime_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime Task Id"
          },
          "skills_applied": {
            "items": {
              "type": "string"
            },
            "title": "Skills Applied",
            "type": "array"
          }
        },
        "required": [
          "instance_id",
          "message"
        ],
        "title": "ApplyAllUpdatesResponse",
        "type": "object"
      },
      "ApplyResult": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "rules_created": {
            "title": "Rules Created",
            "type": "integer"
          },
          "rules_skipped": {
            "title": "Rules Skipped",
            "type": "integer"
          },
          "template_id": {
            "format": "uuid",
            "title": "Template Id",
            "type": "string"
          }
        },
        "required": [
          "template_id",
          "customer_id",
          "rules_created",
          "rules_skipped"
        ],
        "title": "ApplyResult",
        "type": "object"
      },
      "ApplyTemplateRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "ApplyTemplateRequest",
        "type": "object"
      },
      "ApplyUpdatesRequest": {
        "description": "Request to apply pending updates to a running instance.",
        "properties": {
          "force": {
            "default": false,
            "title": "Force",
            "type": "boolean"
          },
          "restart_agent": {
            "default": false,
            "title": "Restart Agent",
            "type": "boolean"
          }
        },
        "title": "ApplyUpdatesRequest",
        "type": "object"
      },
      "ApplyUpdatesResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "status",
          "message"
        ],
        "title": "ApplyUpdatesResponse",
        "type": "object"
      },
      "ApprovalRequest": {
        "properties": {
          "action": {
            "maxLength": 100,
            "title": "Action",
            "type": "string"
          },
          "approver_person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approver Person Id"
          },
          "approver_role": {
            "default": "customer",
            "description": "Must be 'owner' or 'customer'",
            "pattern": "^(owner|customer)$",
            "title": "Approver Role",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "expires_in_hours": {
            "default": 24,
            "maximum": 168.0,
            "minimum": 1.0,
            "title": "Expires In Hours",
            "type": "integer"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller-provided idempotency key for safe retries",
            "title": "Idempotency Key"
          },
          "notify_channel": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notify Channel"
          },
          "rule_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Id"
          },
          "serialized_intent": {
            "description": "Full params to replay on approval",
            "title": "Serialized Intent",
            "type": "object"
          },
          "skill_slug": {
            "maxLength": 100,
            "title": "Skill Slug",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "skill_slug",
          "action",
          "serialized_intent"
        ],
        "title": "ApprovalRequest",
        "type": "object"
      },
      "ApprovalResolve": {
        "properties": {
          "action": {
            "description": "Must be 'approve' or 'reject'",
            "pattern": "^(approve|reject)$",
            "title": "Action",
            "type": "string"
          },
          "approval_ref": {
            "description": "APR-xxxx reference",
            "title": "Approval Ref",
            "type": "string"
          },
          "pin_verified": {
            "description": "Whether PIN was verified by caller \u2014 required, no default",
            "title": "Pin Verified",
            "type": "boolean"
          },
          "resolution_channel": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Channel"
          },
          "resolved_by": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved By"
          },
          "resolver_person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Person ID if approval targets a specific person",
            "title": "Resolver Person Id"
          },
          "resolver_role": {
            "description": "Role of resolver",
            "pattern": "^(owner|customer)$",
            "title": "Resolver Role",
            "type": "string"
          }
        },
        "required": [
          "approval_ref",
          "pin_verified",
          "action",
          "resolver_role"
        ],
        "title": "ApprovalResolve",
        "type": "object"
      },
      "ApprovedPrimitivesOut": {
        "properties": {
          "approved_channels": {
            "items": {},
            "title": "Approved Channels",
            "type": "array"
          },
          "approved_llm_providers": {
            "items": {},
            "title": "Approved Llm Providers",
            "type": "array"
          },
          "approved_mcp_servers": {
            "items": {},
            "title": "Approved Mcp Servers",
            "type": "array"
          },
          "approved_skills": {
            "items": {},
            "title": "Approved Skills",
            "type": "array"
          },
          "approved_stt_providers": {
            "items": {},
            "title": "Approved Stt Providers",
            "type": "array"
          },
          "approved_tts_providers": {
            "items": {},
            "title": "Approved Tts Providers",
            "type": "array"
          },
          "approved_voice_modes": {
            "items": {},
            "title": "Approved Voice Modes",
            "type": "array"
          },
          "approved_voice_providers": {
            "items": {},
            "title": "Approved Voice Providers",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "max_mcp_servers_per_instance": {
            "title": "Max Mcp Servers Per Instance",
            "type": "integer"
          },
          "max_skills_per_instance": {
            "title": "Max Skills Per Instance",
            "type": "integer"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "approved_skills",
          "approved_mcp_servers",
          "approved_voice_providers",
          "approved_voice_modes",
          "approved_stt_providers",
          "approved_tts_providers",
          "approved_llm_providers",
          "approved_channels",
          "max_skills_per_instance",
          "max_mcp_servers_per_instance"
        ],
        "title": "ApprovedPrimitivesOut",
        "type": "object"
      },
      "ApprovedPrimitivesUpdate": {
        "properties": {
          "approved_channels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Channels"
          },
          "approved_llm_providers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Llm Providers"
          },
          "approved_mcp_servers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Mcp Servers"
          },
          "approved_skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Skills"
          },
          "approved_stt_providers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Stt Providers"
          },
          "approved_tts_providers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Tts Providers"
          },
          "approved_voice_modes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Voice Modes"
          },
          "approved_voice_providers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved Voice Providers"
          },
          "max_mcp_servers_per_instance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Mcp Servers Per Instance"
          },
          "max_skills_per_instance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Skills Per Instance"
          }
        },
        "title": "ApprovedPrimitivesUpdate",
        "type": "object"
      },
      "AssignmentCreate": {
        "properties": {
          "channel": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel"
          },
          "person_id": {
            "format": "uuid",
            "title": "Person Id",
            "type": "string"
          }
        },
        "required": [
          "person_id"
        ],
        "title": "AssignmentCreate",
        "type": "object"
      },
      "AssignmentOut": {
        "properties": {
          "calendar_link_sent": {
            "title": "Calendar Link Sent",
            "type": "boolean"
          },
          "channel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel"
          },
          "contacted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contacted At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "person_id": {
            "format": "uuid",
            "title": "Person Id",
            "type": "string"
          },
          "responded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responded At"
          },
          "shift_id": {
            "format": "uuid",
            "title": "Shift Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "shift_id",
          "person_id",
          "status",
          "calendar_link_sent",
          "created_at"
        ],
        "title": "AssignmentOut",
        "type": "object"
      },
      "AssignmentUpdate": {
        "properties": {
          "calendar_link_sent": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calendar Link Sent"
          },
          "channel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "AssignmentUpdate",
        "type": "object"
      },
      "AuditLogEntry": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Email"
          },
          "actor_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "grant_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grant Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          }
        },
        "required": [
          "id",
          "instance_id",
          "grant_id",
          "action",
          "actor_id",
          "actor_email",
          "details",
          "ip_address",
          "created_at"
        ],
        "title": "AuditLogEntry",
        "type": "object"
      },
      "AuditLogOut": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/AuditLogEntry"
            },
            "title": "Entries",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "entries",
          "total"
        ],
        "title": "AuditLogOut",
        "type": "object"
      },
      "AvailableUpdatesResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "mcp_servers": {
            "items": {
              "$ref": "#/components/schemas/ComponentUpdate"
            },
            "title": "Mcp Servers",
            "type": "array"
          },
          "runtime": {
            "$ref": "#/components/schemas/ComponentUpdate"
          },
          "skills": {
            "items": {
              "$ref": "#/components/schemas/ComponentUpdate"
            },
            "title": "Skills",
            "type": "array"
          },
          "total_available": {
            "default": 0,
            "title": "Total Available",
            "type": "integer"
          },
          "update_policy": {
            "$ref": "#/components/schemas/UpdatePolicyOut"
          },
          "versions_reported_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Versions Reported At"
          }
        },
        "required": [
          "instance_id",
          "runtime"
        ],
        "title": "AvailableUpdatesResponse",
        "type": "object"
      },
      "BatchCallRequest": {
        "properties": {
          "calls": {
            "items": {
              "$ref": "#/components/schemas/OutboundCallRequest"
            },
            "maxItems": 30,
            "title": "Calls",
            "type": "array"
          },
          "delay_between_ms": {
            "default": 2000,
            "maximum": 10000.0,
            "minimum": 500.0,
            "title": "Delay Between Ms",
            "type": "integer"
          }
        },
        "required": [
          "calls"
        ],
        "title": "BatchCallRequest",
        "type": "object"
      },
      "BillingOut": {
        "description": "Combined billing response \u2014 plan + usage.",
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/src__api__billing__PlanOut"
          },
          "subscribed_tier_ids": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Subscribed Tier Ids",
            "type": "array"
          },
          "usage": {
            "$ref": "#/components/schemas/UsagePeriodOut"
          }
        },
        "required": [
          "plan",
          "usage"
        ],
        "title": "BillingOut",
        "type": "object"
      },
      "BindingCreate": {
        "properties": {
          "channel_address": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Channel Address",
            "type": "string"
          },
          "channel_type": {
            "description": "One of: ('whatsapp', 'sms', 'voice', 'telegram', 'email')",
            "title": "Channel Type",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "person_id": {
            "format": "uuid",
            "title": "Person Id",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "person_id",
          "channel_type",
          "channel_address"
        ],
        "title": "BindingCreate",
        "type": "object"
      },
      "Body_upload_chat_media_v1_instances__instance_id__chat_media_post": {
        "properties": {
          "file": {
            "format": "binary",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_chat_media_v1_instances__instance_id__chat_media_post",
        "type": "object"
      },
      "Body_upload_custom_site_v1_website_upload_post": {
        "properties": {
          "file": {
            "format": "binary",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_custom_site_v1_website_upload_post",
        "type": "object"
      },
      "Body_upload_instance_custom_site_v1_instances__instance_id__website_upload_post": {
        "properties": {
          "file": {
            "format": "binary",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_instance_custom_site_v1_instances__instance_id__website_upload_post",
        "type": "object"
      },
      "Body_upload_logo_v1_brand_logo_post": {
        "properties": {
          "file": {
            "format": "binary",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_logo_v1_brand_logo_post",
        "type": "object"
      },
      "Body_upload_media_v1_website__config_id__media_post": {
        "properties": {
          "file": {
            "format": "binary",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_media_v1_website__config_id__media_post",
        "type": "object"
      },
      "BrandingOut": {
        "description": "Full branding config returned to the frontend.",
        "properties": {
          "accent_color": {
            "title": "Accent Color",
            "type": "string"
          },
          "background_color": {
            "title": "Background Color",
            "type": "string"
          },
          "body_font": {
            "title": "Body Font",
            "type": "string"
          },
          "business_name": {
            "title": "Business Name",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "custom_domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Domain"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "domain_verified": {
            "title": "Domain Verified",
            "type": "boolean"
          },
          "edge_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Edge Instance Id"
          },
          "favicon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Url"
          },
          "heading_font": {
            "title": "Heading Font",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "mono_font": {
            "title": "Mono Font",
            "type": "string"
          },
          "og_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Og Image Url"
          },
          "powered_by_enabled": {
            "title": "Powered By Enabled",
            "type": "boolean"
          },
          "primary_color": {
            "title": "Primary Color",
            "type": "string"
          },
          "social_linkedin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Social Linkedin"
          },
          "social_twitter": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Social Twitter"
          },
          "social_website": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Social Website"
          },
          "ssl_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ssl Error"
          },
          "ssl_status": {
            "default": "none",
            "title": "Ssl Status",
            "type": "string"
          },
          "support_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Support Email"
          },
          "surface_color": {
            "title": "Surface Color",
            "type": "string"
          },
          "tagline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tagline"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "text_color": {
            "title": "Text Color",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "business_name",
          "primary_color",
          "accent_color",
          "background_color",
          "surface_color",
          "text_color",
          "heading_font",
          "body_font",
          "mono_font",
          "domain_verified",
          "powered_by_enabled",
          "created_at",
          "updated_at"
        ],
        "title": "BrandingOut",
        "type": "object"
      },
      "BrandingUpdate": {
        "description": "Partial update - only send the fields you want to change.\n\n\"I'll have what she's having.\" - When Harry Met Sally\n(what every reseller says when they see a well-branded competitor)",
        "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"
          },
          "body_font": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Font"
          },
          "business_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Business Name"
          },
          "custom_domain": {
            "anyOf": [
              {
                "maxLength": 253,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Domain"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "edge_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Edge Instance Id"
          },
          "favicon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Url"
          },
          "heading_font": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Heading Font"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "mono_font": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mono Font"
          },
          "og_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Og Image Url"
          },
          "powered_by_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Powered By Enabled"
          },
          "primary_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9a-fA-F]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Color"
          },
          "social_linkedin": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Social Linkedin"
          },
          "social_twitter": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Social Twitter"
          },
          "social_website": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Social Website"
          },
          "support_email": {
            "anyOf": [
              {
                "maxLength": 254,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Support Email"
          },
          "surface_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9a-fA-F]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Surface Color"
          },
          "tagline": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tagline"
          },
          "text_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9a-fA-F]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text Color"
          }
        },
        "title": "BrandingUpdate",
        "type": "object"
      },
      "BudgetStatusResponse": {
        "properties": {
          "budget_daily_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Daily Usd"
          },
          "by_model": {
            "title": "By Model",
            "type": "object"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "remaining_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Usd"
          },
          "spent_today_usd": {
            "title": "Spent Today Usd",
            "type": "number"
          }
        },
        "required": [
          "instance_id",
          "budget_daily_usd",
          "spent_today_usd",
          "remaining_usd",
          "by_model"
        ],
        "title": "BudgetStatusResponse",
        "type": "object"
      },
      "BulkImportResult": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "errors": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          }
        },
        "required": [
          "created"
        ],
        "title": "BulkImportResult",
        "type": "object"
      },
      "CalendarEventCreate": {
        "properties": {
          "attendees": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Email addresses of attendees",
            "title": "Attendees"
          },
          "calendar_id": {
            "default": "primary",
            "description": "Calendar ID (default: primary)",
            "title": "Calendar Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event description/notes",
            "title": "Description"
          },
          "end_time": {
            "description": "Event end (ISO 8601)",
            "format": "date-time",
            "title": "End Time",
            "type": "string"
          },
          "location": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "start_time": {
            "description": "Event start (ISO 8601)",
            "format": "date-time",
            "title": "Start Time",
            "type": "string"
          },
          "summary": {
            "description": "Event title",
            "maxLength": 500,
            "title": "Summary",
            "type": "string"
          }
        },
        "required": [
          "summary",
          "start_time",
          "end_time"
        ],
        "title": "CalendarEventCreate",
        "type": "object"
      },
      "CalendarEventListOut": {
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/CalendarEventOut"
            },
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "events",
          "count"
        ],
        "title": "CalendarEventListOut",
        "type": "object"
      },
      "CalendarEventOut": {
        "properties": {
          "end": {
            "title": "End",
            "type": "string"
          },
          "html_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Html Link"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "start": {
            "title": "Start",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "summary": {
            "title": "Summary",
            "type": "string"
          }
        },
        "required": [
          "id",
          "summary",
          "start",
          "end"
        ],
        "title": "CalendarEventOut",
        "type": "object"
      },
      "CallbackRequest": {
        "properties": {
          "message": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "seq": {
            "maximum": 4.0,
            "minimum": 1.0,
            "title": "Seq",
            "type": "integer"
          },
          "stage": {
            "pattern": "^(installing|configuring|securing|ready|error)$",
            "title": "Stage",
            "type": "string"
          }
        },
        "required": [
          "stage",
          "seq"
        ],
        "title": "CallbackRequest",
        "type": "object"
      },
      "CallbackResponse": {
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "message"
        ],
        "title": "CallbackResponse",
        "type": "object"
      },
      "CascadeStartRequest": {
        "properties": {
          "shift_id": {
            "format": "uuid",
            "title": "Shift Id",
            "type": "string"
          },
          "tier": {
            "default": 1,
            "maximum": 5.0,
            "minimum": 1.0,
            "title": "Tier",
            "type": "integer"
          }
        },
        "required": [
          "shift_id"
        ],
        "title": "CascadeStartRequest",
        "type": "object"
      },
      "CertRenewRequest": {
        "properties": {
          "csr_pem": {
            "maxLength": 10000,
            "minLength": 100,
            "title": "Csr Pem",
            "type": "string"
          },
          "wg_public_key": {
            "title": "Wg Public Key",
            "type": "string"
          }
        },
        "required": [
          "csr_pem",
          "wg_public_key"
        ],
        "title": "CertRenewRequest",
        "type": "object"
      },
      "CertRenewResponse": {
        "properties": {
          "cert_pem": {
            "title": "Cert Pem",
            "type": "string"
          },
          "cert_serial": {
            "title": "Cert Serial",
            "type": "string"
          },
          "expires_at": {
            "title": "Expires At",
            "type": "string"
          }
        },
        "required": [
          "cert_pem",
          "cert_serial",
          "expires_at"
        ],
        "title": "CertRenewResponse",
        "type": "object"
      },
      "CertRequest": {
        "properties": {
          "bootstrap_token": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Bootstrap Token",
            "type": "string"
          },
          "csr_pem": {
            "maxLength": 10000,
            "minLength": 100,
            "title": "Csr Pem",
            "type": "string"
          }
        },
        "required": [
          "bootstrap_token",
          "csr_pem"
        ],
        "title": "CertRequest",
        "type": "object"
      },
      "CertResponse": {
        "properties": {
          "cert_pem": {
            "title": "Cert Pem",
            "type": "string"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "cert_pem",
          "session_id"
        ],
        "title": "CertResponse",
        "type": "object"
      },
      "ChangePasswordRequest": {
        "properties": {
          "current_password": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Current Password",
            "type": "string"
          },
          "new_password": {
            "maxLength": 128,
            "minLength": 8,
            "title": "New Password",
            "type": "string"
          }
        },
        "required": [
          "current_password",
          "new_password"
        ],
        "title": "ChangePasswordRequest",
        "type": "object"
      },
      "ChannelEndpointCreate": {
        "properties": {
          "channel_type": {
            "description": "telegram|whatsapp|voice|sms|email|web_chat",
            "title": "Channel Type",
            "type": "string"
          },
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Channel-specific config (streaming mode, processing rules, etc.)",
            "title": "Config"
          },
          "connection_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "FK to customer_connections for customer-owned channels",
            "title": "Connection Id"
          },
          "credential_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "FK to mcp_credentials for platform-provisioned channels",
            "title": "Credential Id"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "external_identifier": {
            "description": "Phone number, bot username, email address, etc.",
            "maxLength": 255,
            "title": "External Identifier",
            "type": "string"
          },
          "provider": {
            "description": "telegram|meta_cloud|retell|twilio|gmail|resend|etc.",
            "maxLength": 50,
            "title": "Provider",
            "type": "string"
          },
          "webhook_secret": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Secret"
          }
        },
        "required": [
          "channel_type",
          "external_identifier",
          "provider"
        ],
        "title": "ChannelEndpointCreate",
        "type": "object"
      },
      "ChannelEndpointOut": {
        "properties": {
          "channel_type": {
            "title": "Channel Type",
            "type": "string"
          },
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "connection_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "external_identifier": {
            "title": "External Identifier",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "last_event_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Event At"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "instance_id",
          "channel_type",
          "external_identifier",
          "provider",
          "status",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "title": "ChannelEndpointOut",
        "type": "object"
      },
      "ChannelEndpointUpdate": {
        "properties": {
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "external_identifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Identifier"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "ChannelEndpointUpdate",
        "type": "object"
      },
      "ChannelListOut": {
        "properties": {
          "channels": {
            "items": {
              "$ref": "#/components/schemas/ChannelEndpointOut"
            },
            "title": "Channels",
            "type": "array"
          },
          "count": {
            "title": "Count",
            "type": "integer"
          }
        },
        "required": [
          "channels",
          "count"
        ],
        "title": "ChannelListOut",
        "type": "object"
      },
      "ChartOut": {
        "description": "Time-series chart data.",
        "properties": {
          "period_label": {
            "title": "Period Label",
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/ChartPoint"
            },
            "title": "Points",
            "type": "array"
          }
        },
        "required": [
          "points",
          "period_label"
        ],
        "title": "ChartOut",
        "type": "object"
      },
      "ChartPoint": {
        "description": "Single data point for the time-series chart.",
        "properties": {
          "cost_usd": {
            "title": "Cost Usd",
            "type": "string"
          },
          "date": {
            "title": "Date",
            "type": "string"
          },
          "end_users": {
            "title": "End Users",
            "type": "integer"
          },
          "instances": {
            "title": "Instances",
            "type": "integer"
          },
          "requests": {
            "title": "Requests",
            "type": "integer"
          },
          "tokens": {
            "title": "Tokens",
            "type": "integer"
          }
        },
        "required": [
          "date",
          "requests",
          "tokens",
          "cost_usd",
          "end_users",
          "instances"
        ],
        "title": "ChartPoint",
        "type": "object"
      },
      "ChatMediaUploadResponse": {
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "media_id": {
            "title": "Media Id",
            "type": "string"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "storage_key": {
            "title": "Storage Key",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "media_id",
          "content_type",
          "size_bytes",
          "storage_key"
        ],
        "title": "ChatMediaUploadResponse",
        "type": "object"
      },
      "CheckoutSessionIn": {
        "description": "Create a Stripe Checkout Session for a customer subscription.\n\"Take my money!\" \u2014 Fry, Futurama",
        "properties": {
          "cancel_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel Url"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "product_tier_id": {
            "format": "uuid",
            "title": "Product Tier Id",
            "type": "string"
          },
          "success_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Success Url"
          }
        },
        "required": [
          "customer_id",
          "product_tier_id"
        ],
        "title": "CheckoutSessionIn",
        "type": "object"
      },
      "CheckoutSessionOut": {
        "properties": {
          "checkout_url": {
            "title": "Checkout Url",
            "type": "string"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "stripe_customer_id": {
            "title": "Stripe Customer Id",
            "type": "string"
          }
        },
        "required": [
          "checkout_url",
          "session_id",
          "stripe_customer_id"
        ],
        "title": "CheckoutSessionOut",
        "type": "object"
      },
      "ChunkResult": {
        "properties": {
          "chunk_id": {
            "title": "Chunk Id",
            "type": "string"
          },
          "chunk_index": {
            "title": "Chunk Index",
            "type": "integer"
          },
          "chunk_text": {
            "title": "Chunk Text",
            "type": "string"
          },
          "similarity": {
            "title": "Similarity",
            "type": "number"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          },
          "source_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Name"
          },
          "source_type": {
            "title": "Source Type",
            "type": "string"
          },
          "token_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Count"
          }
        },
        "required": [
          "chunk_id",
          "source_type",
          "source_id",
          "source_name",
          "chunk_index",
          "chunk_text",
          "token_count",
          "similarity"
        ],
        "title": "ChunkResult",
        "type": "object"
      },
      "ClaimCodeOut": {
        "description": "Response when a claim code is generated for an identity.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "expires_in_seconds": {
            "default": 900,
            "title": "Expires In Seconds",
            "type": "integer"
          },
          "identity_id": {
            "format": "uuid",
            "title": "Identity Id",
            "type": "string"
          },
          "instructions": {
            "title": "Instructions",
            "type": "string"
          }
        },
        "required": [
          "code",
          "identity_id",
          "instructions"
        ],
        "title": "ClaimCodeOut",
        "type": "object"
      },
      "CleanupResponse": {
        "properties": {
          "cleaned": {
            "title": "Cleaned",
            "type": "integer"
          },
          "errors": {
            "title": "Errors",
            "type": "integer"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "cleaned",
          "errors",
          "message"
        ],
        "title": "CleanupResponse",
        "type": "object"
      },
      "CloneCustomerRequest": {
        "properties": {
          "clone_rules": {
            "default": true,
            "title": "Clone Rules",
            "type": "boolean"
          },
          "company_name": {
            "maxLength": 200,
            "title": "Company Name",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "source_customer_id": {
            "format": "uuid",
            "title": "Source Customer Id",
            "type": "string"
          }
        },
        "required": [
          "source_customer_id",
          "company_name"
        ],
        "title": "CloneCustomerRequest",
        "type": "object"
      },
      "ComponentUpdate": {
        "description": "A single component that has an available update.\n\nVersion field semantics vary by component_type:\n\n- **skill / mcp_server**: current_version and available_version contain\n  human-readable semver strings (e.g. \"1.0.0\", \"1.1.0\") resolved from\n  MarketplaceSkillVersion.version.\n\n- **runtime**: current_version and available_version contain 12-character\n  truncated SHA-256 hash prefixes (e.g. \"a1b2c3d4e5f6\") since the\n  runtime bundle has no semver \u2014 same convention as Docker/Git short IDs.\n\nNeither field ever contains raw database UUIDs.\n\nWhen update_reason is \"content_changed\", has_update is true but\ncurrent_version may equal available_version (same version, different\ncontent). The dashboard should use update_reason to explain this.\n\n\"These go to eleven.\" \u2014 Nigel Tufnel, This Is Spinal Tap",
        "properties": {
          "available_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Available Version"
          },
          "changelog": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Changelog"
          },
          "component_type": {
            "title": "Component Type",
            "type": "string"
          },
          "current_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Version"
          },
          "has_update": {
            "default": false,
            "title": "Has Update",
            "type": "boolean"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "update_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Update Reason"
          }
        },
        "required": [
          "component_type"
        ],
        "title": "ComponentUpdate",
        "type": "object"
      },
      "ComposeRequest": {
        "properties": {
          "instance_overrides": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Overrides"
          },
          "recipe_id": {
            "format": "uuid",
            "title": "Recipe Id",
            "type": "string"
          }
        },
        "required": [
          "recipe_id"
        ],
        "title": "ComposeRequest",
        "type": "object"
      },
      "ComposeResponse": {
        "properties": {
          "resolved_config": {
            "title": "Resolved Config",
            "type": "object"
          },
          "template_name": {
            "title": "Template Name",
            "type": "string"
          },
          "violations": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Violations",
            "type": "array"
          }
        },
        "required": [
          "resolved_config",
          "template_name"
        ],
        "title": "ComposeResponse",
        "type": "object"
      },
      "ConditionSchema": {
        "properties": {
          "field": {
            "description": "Payload field to check",
            "maxLength": 100,
            "title": "Field",
            "type": "string"
          },
          "op": {
            "description": "Comparison operator",
            "title": "Op",
            "type": "string"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "items": {},
                "type": "array"
              }
            ],
            "description": "Value to compare against",
            "title": "Value"
          }
        },
        "required": [
          "field",
          "op",
          "value"
        ],
        "title": "ConditionSchema",
        "type": "object"
      },
      "ConnectOut": {
        "properties": {
          "auth_url": {
            "title": "Auth Url",
            "type": "string"
          }
        },
        "required": [
          "auth_url"
        ],
        "title": "ConnectOut",
        "type": "object"
      },
      "ConnectRequest": {
        "properties": {
          "app_name": {
            "description": "App to connect (e.g. hubspot)",
            "maxLength": 100,
            "title": "App Name",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "provider_slug": {
            "description": "Plugin provider slug (e.g. composio)",
            "title": "Provider Slug",
            "type": "string"
          },
          "redirect_url": {
            "maxLength": 500,
            "title": "Redirect Url",
            "type": "string"
          }
        },
        "required": [
          "provider_slug",
          "app_name",
          "customer_id",
          "redirect_url"
        ],
        "title": "ConnectRequest",
        "type": "object"
      },
      "ConnectStatusOut": {
        "description": "Current Stripe Connect status for the customer.",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          },
          "charges_enabled": {
            "default": false,
            "title": "Charges Enabled",
            "type": "boolean"
          },
          "details_submitted": {
            "default": false,
            "title": "Details Submitted",
            "type": "boolean"
          },
          "has_account": {
            "title": "Has Account",
            "type": "boolean"
          },
          "onboarding_complete": {
            "default": false,
            "title": "Onboarding Complete",
            "type": "boolean"
          },
          "payouts_enabled": {
            "default": false,
            "title": "Payouts Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "has_account"
        ],
        "title": "ConnectStatusOut",
        "type": "object"
      },
      "ConnectionCreate": {
        "properties": {
          "auth_type": {
            "default": "oauth2",
            "description": "One of: ('oauth2', 'api_key', 'basic')",
            "title": "Auth Type",
            "type": "string"
          },
          "credentials": {
            "description": "Provider credentials (stored encrypted)",
            "title": "Credentials",
            "type": "object"
          },
          "metadata_json": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata Json"
          },
          "name": {
            "description": "admin@iqm.com.au, IQM Master Roster, etc.",
            "maxLength": 255,
            "title": "Name",
            "type": "string"
          },
          "provider": {
            "description": "gmail, xero, google_calendar, deputy, etc.",
            "maxLength": 50,
            "title": "Provider",
            "type": "string"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          }
        },
        "required": [
          "provider",
          "name",
          "credentials"
        ],
        "title": "ConnectionCreate",
        "type": "object"
      },
      "ConnectionListOut": {
        "properties": {
          "connections": {
            "items": {
              "$ref": "#/components/schemas/ConnectionOut"
            },
            "title": "Connections",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "connections",
          "total"
        ],
        "title": "ConnectionListOut",
        "type": "object"
      },
      "ConnectionOut": {
        "properties": {
          "auth_type": {
            "title": "Auth Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "grants": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/src__api__connections__GrantOut"
            },
            "title": "Grants",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "provider",
          "name",
          "auth_type",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "ConnectionOut",
        "type": "object"
      },
      "ConsentUpdateRequest": {
        "properties": {
          "consent_debug_access": {
            "title": "Consent Debug Access",
            "type": "boolean"
          }
        },
        "required": [
          "consent_debug_access"
        ],
        "title": "ConsentUpdateRequest",
        "type": "object"
      },
      "ConsentUpdateResponse": {
        "properties": {
          "consent_debug_access": {
            "title": "Consent Debug Access",
            "type": "boolean"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "consent_debug_access",
          "message"
        ],
        "title": "ConsentUpdateResponse",
        "type": "object"
      },
      "CreateApiKeyRequest": {
        "description": "Body for `POST /v1/settings/api-keys`.\n\nPlan v1.8 amendments A5/A7/B1/B2: the caller picks ONE of three\ngrant paths \u2014 explicit scopes, named preset, or break-glass.\n\n  - `scopes`: array of `<resource>:<verb>` tags. Wildcards\n    accepted (e.g. `instances:*`); expanded server-side at\n    issuance time. Pure `*` / `*:*` literals refused \u2014 use\n    `break_glass=True` instead.\n  - `preset`: one of `read-only-analyst | operator |\n    billing-only`. Resolved server-side; the row stores the\n    concrete array.\n  - `break_glass=True`: shortcut for the `full` preset. Requires\n    `confirmation_phrase == \"BREAK GLASS\"` and is automatically\n    capped at 24 hours TTL regardless of `expires_at`.\n\nExactly ONE of those three paths must be set per request.",
        "properties": {
          "break_glass": {
            "default": false,
            "title": "Break Glass",
            "type": "boolean"
          },
          "confirmation_phrase": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmation Phrase"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "key_type": {
            "default": "live",
            "pattern": "^(live|test)$",
            "title": "Key Type",
            "type": "string"
          },
          "name": {
            "default": "Default",
            "maxLength": 100,
            "title": "Name",
            "type": "string"
          },
          "preset": {
            "anyOf": [
              {
                "pattern": "^(read-only-analyst|operator|billing-only)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preset"
          },
          "rate_limit_per_hour": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Per Hour"
          },
          "rate_limit_per_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Per Minute"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          }
        },
        "title": "CreateApiKeyRequest",
        "type": "object"
      },
      "CreateApiKeyResponse": {
        "description": "Returned once on creation - plaintext key never shown again.\n\"After this, there is no turning back.\" - Morpheus, The Matrix",
        "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": {
            "title": "Id",
            "type": "string"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "key_type": {
            "title": "Key Type",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "plaintext_key": {
            "title": "Plaintext Key",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "key_prefix",
          "key_type",
          "plaintext_key",
          "scopes",
          "expires_at",
          "created_at"
        ],
        "title": "CreateApiKeyResponse",
        "type": "object"
      },
      "CreateInstanceRequest": {
        "properties": {
          "agent_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          },
          "manifest_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manifest Id"
          },
          "preset_id": {
            "default": "personal_assistant",
            "title": "Preset Id",
            "type": "string"
          },
          "recipe_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipe Id"
          },
          "region_id": {
            "title": "Region Id",
            "type": "string"
          },
          "tier_id": {
            "title": "Tier Id",
            "type": "string"
          },
          "user_display_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Display Name"
          },
          "website_template_slug": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Website Template Slug"
          },
          "workflow_slugs": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Slugs"
          }
        },
        "required": [
          "tier_id",
          "region_id"
        ],
        "title": "CreateInstanceRequest",
        "type": "object"
      },
      "CreateInstanceResponse": {
        "properties": {
          "idempotency_key": {
            "title": "Idempotency Key",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "idempotency_key",
          "message"
        ],
        "title": "CreateInstanceResponse",
        "type": "object"
      },
      "CreditCheckRequest": {
        "description": "Pre-call credit check request from the VPS agent.",
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "estimated_tokens_in": {
            "maximum": 200000.0,
            "minimum": 0.0,
            "title": "Estimated Tokens In",
            "type": "integer"
          },
          "estimated_tokens_out": {
            "maximum": 200000.0,
            "minimum": 0.0,
            "title": "Estimated Tokens Out",
            "type": "integer"
          },
          "key_source": {
            "default": "platform",
            "pattern": "^(platform|tenant|end_user)$",
            "title": "Key Source",
            "type": "string"
          },
          "model": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Model",
            "type": "string"
          },
          "request_id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "model",
          "estimated_tokens_in",
          "estimated_tokens_out"
        ],
        "title": "CreditCheckRequest",
        "type": "object"
      },
      "CreditCheckResponse": {
        "properties": {
          "allowed": {
            "title": "Allowed",
            "type": "boolean"
          },
          "byok_exempt": {
            "default": false,
            "title": "Byok Exempt",
            "type": "boolean"
          },
          "credits_held": {
            "default": 0,
            "title": "Credits Held",
            "type": "number"
          },
          "credits_remaining": {
            "default": 0,
            "title": "Credits Remaining",
            "type": "number"
          },
          "hold_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hold Id"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "retry_after_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry After Seconds"
          },
          "server_key_source": {
            "default": "platform",
            "title": "Server Key Source",
            "type": "string"
          },
          "tier_limits": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TierLimitsOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "allowed"
        ],
        "title": "CreditCheckResponse",
        "type": "object"
      },
      "CreditReleaseRequest": {
        "description": "Release a credit hold when an LLM call fails.",
        "properties": {
          "hold_id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Hold Id",
            "type": "string"
          },
          "request_id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "hold_id"
        ],
        "title": "CreditReleaseRequest",
        "type": "object"
      },
      "CreditReleaseResponse": {
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "released": {
            "title": "Released",
            "type": "boolean"
          }
        },
        "required": [
          "released"
        ],
        "title": "CreditReleaseResponse",
        "type": "object"
      },
      "CsvEntityImportRequest": {
        "properties": {
          "column_map": {
            "maxProperties": 26,
            "title": "Column Map",
            "type": "object"
          },
          "definition_slug": {
            "title": "Definition Slug",
            "type": "string"
          },
          "has_header": {
            "default": true,
            "title": "Has Header",
            "type": "boolean"
          },
          "rows": {
            "description": "2D array (max 10K rows)",
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "maxItems": 10000,
            "title": "Rows",
            "type": "array"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "required": [
          "rows",
          "definition_slug",
          "column_map"
        ],
        "title": "CsvEntityImportRequest",
        "type": "object"
      },
      "CsvStaffImportRequest": {
        "properties": {
          "column_map": {
            "description": "Map column indices to staff fields (max 26 columns). E.g. {'0': 'name', '1': 'phone'}",
            "maxProperties": 26,
            "title": "Column Map",
            "type": "object"
          },
          "has_header": {
            "default": true,
            "title": "Has Header",
            "type": "boolean"
          },
          "rows": {
            "description": "2D array of row data (max 10K rows)",
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "maxItems": 10000,
            "title": "Rows",
            "type": "array"
          }
        },
        "required": [
          "rows",
          "column_map"
        ],
        "title": "CsvStaffImportRequest",
        "type": "object"
      },
      "CustomerConfigOut": {
        "properties": {
          "config_overlay": {
            "title": "Config Overlay",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "customer_id",
          "config_overlay",
          "created_at",
          "updated_at"
        ],
        "title": "CustomerConfigOut",
        "type": "object"
      },
      "CustomerConfigUpdate": {
        "properties": {
          "config_overlay": {
            "title": "Config Overlay",
            "type": "object"
          }
        },
        "required": [
          "config_overlay"
        ],
        "title": "CustomerConfigUpdate",
        "type": "object"
      },
      "CustomerContextOut": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "primary_site_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Site Id"
          },
          "sites": {
            "items": {
              "$ref": "#/components/schemas/SiteInfo"
            },
            "title": "Sites",
            "type": "array"
          }
        },
        "required": [
          "customer_id",
          "sites"
        ],
        "title": "CustomerContextOut",
        "type": "object"
      },
      "CustomerCreate": {
        "description": "Create a new end-customer for the tenant.",
        "properties": {
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "title": "CustomerCreate",
        "type": "object"
      },
      "CustomerCreatedOut": {
        "properties": {
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at"
        ],
        "title": "CustomerCreatedOut",
        "type": "object"
      },
      "CustomerDetailOut": {
        "description": "Extended customer detail with subscriptions and instances.\n\"Show me the money!\" \u2014 Rod Tidwell, Jerry Maguire",
        "properties": {
          "active_subscription_count": {
            "default": 0,
            "title": "Active Subscription Count",
            "type": "integer"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_count": {
            "default": 0,
            "title": "Instance Count",
            "type": "integer"
          },
          "instances": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CustomerInstanceOut"
            },
            "title": "Instances",
            "type": "array"
          },
          "latest_subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Subscription Status"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "running_instance_count": {
            "default": 0,
            "title": "Running Instance Count",
            "type": "integer"
          },
          "stripe_customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Customer Id"
          },
          "subscription_count": {
            "default": 0,
            "title": "Subscription Count",
            "type": "integer"
          },
          "subscriptions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/SubscriptionOut"
            },
            "title": "Subscriptions",
            "type": "array"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at",
          "updated_at"
        ],
        "title": "CustomerDetailOut",
        "type": "object"
      },
      "CustomerInstanceOut": {
        "description": "Instance summary for customer detail.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "health_status": {
            "title": "Health Status",
            "type": "string"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          },
          "preset_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preset Id"
          },
          "region_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "hostname",
          "status",
          "health_status",
          "created_at"
        ],
        "title": "CustomerInstanceOut",
        "type": "object"
      },
      "CustomerListOut": {
        "description": "Paginated customer list response.\n\"Here's looking at you, kid.\" - Rick Blaine, Casablanca",
        "properties": {
          "customers": {
            "items": {
              "$ref": "#/components/schemas/CustomerOut"
            },
            "title": "Customers",
            "type": "array"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "per_page": {
            "title": "Per Page",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "total_pages": {
            "title": "Total Pages",
            "type": "integer"
          }
        },
        "required": [
          "customers",
          "total",
          "page",
          "per_page",
          "total_pages"
        ],
        "title": "CustomerListOut",
        "type": "object"
      },
      "CustomerLoginRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "tenant_slug": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "email",
          "tenant_slug"
        ],
        "title": "CustomerLoginRequest",
        "type": "object"
      },
      "CustomerOut": {
        "properties": {
          "active_subscription_count": {
            "default": 0,
            "title": "Active Subscription Count",
            "type": "integer"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_count": {
            "default": 0,
            "title": "Instance Count",
            "type": "integer"
          },
          "latest_subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Subscription Status"
          },
          "running_instance_count": {
            "default": 0,
            "title": "Running Instance Count",
            "type": "integer"
          },
          "subscription_count": {
            "default": 0,
            "title": "Subscription Count",
            "type": "integer"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "required": [
          "id",
          "created_at"
        ],
        "title": "CustomerOut",
        "type": "object"
      },
      "CustomerProfileOut": {
        "properties": {
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "portal_modules": {
            "title": "Portal Modules",
            "type": "object"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "required": [
          "id",
          "email",
          "company_name",
          "industry",
          "timezone",
          "locale"
        ],
        "title": "CustomerProfileOut",
        "type": "object"
      },
      "CustomerProgrammaticTokenRequest": {
        "description": "Body for /v1/customer-auth/token \u2014 exchange magic-link code for tokens, no cookies.",
        "properties": {
          "code": {
            "maxLength": 6,
            "minLength": 6,
            "title": "Code",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "tenant_slug": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "email",
          "tenant_slug",
          "code"
        ],
        "title": "CustomerProgrammaticTokenRequest",
        "type": "object"
      },
      "CustomerRefreshRequest": {
        "properties": {
          "refresh_token": {
            "default": "",
            "title": "Refresh Token",
            "type": "string"
          }
        },
        "title": "CustomerRefreshRequest",
        "type": "object"
      },
      "CustomerTokenResponse": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "expires_in": {
            "default": 3600,
            "title": "Expires In",
            "type": "integer"
          },
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "refresh_token",
          "customer_id",
          "tenant_id"
        ],
        "title": "CustomerTokenResponse",
        "type": "object"
      },
      "CustomerVerifyRequest": {
        "properties": {
          "code": {
            "maxLength": 6,
            "minLength": 6,
            "title": "Code",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "tenant_slug": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "email",
          "tenant_slug",
          "code"
        ],
        "title": "CustomerVerifyRequest",
        "type": "object"
      },
      "DashboardLinkOut": {
        "description": "Stripe Express dashboard login link.",
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "DashboardLinkOut",
        "type": "object"
      },
      "DebugAccessStatus": {
        "description": "Current debug access status for an instance.",
        "properties": {
          "active_grant": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/src__api__debug_access__GrantOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_presets": {
            "items": {
              "type": "object"
            },
            "title": "Duration Presets",
            "type": "array"
          },
          "has_active_grant": {
            "title": "Has Active Grant",
            "type": "boolean"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "recent_grants": {
            "items": {
              "$ref": "#/components/schemas/src__api__debug_access__GrantOut"
            },
            "title": "Recent Grants",
            "type": "array"
          }
        },
        "required": [
          "instance_id",
          "hostname",
          "has_active_grant",
          "active_grant",
          "recent_grants",
          "duration_presets"
        ],
        "title": "DebugAccessStatus",
        "type": "object"
      },
      "DeepHealthResponse": {
        "properties": {
          "cached": {
            "default": false,
            "title": "Cached",
            "type": "boolean"
          },
          "checked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checked At"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "subsystems": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subsystems"
          },
          "uptime_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uptime Seconds"
          }
        },
        "required": [
          "instance_id",
          "status"
        ],
        "title": "DeepHealthResponse",
        "type": "object"
      },
      "DeepLinkOut": {
        "properties": {
          "ics_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ics Url"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "DeepLinkOut",
        "type": "object"
      },
      "DefinitionCreate": {
        "properties": {
          "color": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Display Name",
            "type": "string"
          },
          "field_sensitivity": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "field_name \u2192 standard|sensitive|restricted",
            "title": "Field Sensitivity"
          },
          "icon": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon"
          },
          "schema": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "searchable_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Searchable Fields"
          },
          "slug": {
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9_]*$",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "display_name"
        ],
        "title": "DefinitionCreate",
        "type": "object"
      },
      "DefinitionUpdate": {
        "properties": {
          "color": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "field_sensitivity": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "field_name \u2192 standard|sensitive|restricted",
            "title": "Field Sensitivity"
          },
          "icon": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon"
          },
          "schema": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "searchable_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Searchable Fields"
          }
        },
        "title": "DefinitionUpdate",
        "type": "object"
      },
      "DeleteInstanceResponse": {
        "properties": {
          "already_deleted": {
            "default": false,
            "title": "Already Deleted",
            "type": "boolean"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "status",
          "message"
        ],
        "title": "DeleteInstanceResponse",
        "type": "object"
      },
      "DeleteResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "status"
        ],
        "title": "DeleteResponse",
        "type": "object"
      },
      "DemoStatusOut": {
        "properties": {
          "demo_tenant_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Demo Tenant Name"
          },
          "is_demo_mode": {
            "title": "Is Demo Mode",
            "type": "boolean"
          },
          "real_tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Real Tenant Id"
          }
        },
        "required": [
          "is_demo_mode"
        ],
        "title": "DemoStatusOut",
        "type": "object"
      },
      "DeployCheckResponse": {
        "properties": {
          "missing_connections": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Missing Connections",
            "type": "array"
          },
          "ready": {
            "title": "Ready",
            "type": "boolean"
          },
          "resolved_config": {
            "title": "Resolved Config",
            "type": "object"
          },
          "template_name": {
            "title": "Template Name",
            "type": "string"
          },
          "violations": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Violations",
            "type": "array"
          }
        },
        "required": [
          "template_name",
          "resolved_config",
          "ready"
        ],
        "title": "DeployCheckResponse",
        "type": "object"
      },
      "DeployFromRecipeRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "hostname": {
            "maxLength": 100,
            "title": "Hostname",
            "type": "string"
          },
          "instance_overrides": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Overrides"
          },
          "recipe_id": {
            "format": "uuid",
            "title": "Recipe Id",
            "type": "string"
          }
        },
        "required": [
          "recipe_id",
          "customer_id",
          "hostname"
        ],
        "title": "DeployFromRecipeRequest",
        "type": "object"
      },
      "DiagnosticRequest": {
        "description": "Free-form diagnostic breadcrumb from bootstrap-agent.sh.\n\nDistinct from CallbackRequest: this endpoint does NOT enforce\nmonotonic sequencing or the installing\u2192configuring\u2192securing\u2192\nready stage progression. Bootstrap-agent uses it to ship\narbitrary trace messages (\"hermes:install_sh:start\",\n\"hermes:tail:<200 chars of stderr>\") that land in\nprovision_logs without poisoning the strict callback state\nmachine. Same JWT auth as /callback.",
        "properties": {
          "label": {
            "maxLength": 80,
            "minLength": 1,
            "title": "Label",
            "type": "string"
          },
          "level": {
            "default": "info",
            "pattern": "^(info|warn|error)$",
            "title": "Level",
            "type": "string"
          },
          "message": {
            "maxLength": 2000,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "label",
          "message"
        ],
        "title": "DiagnosticRequest",
        "type": "object"
      },
      "DnsRecordOut": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "record": {
            "title": "Record",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "ttl": {
            "title": "Ttl",
            "type": "string"
          },
          "type": {
            "title": "Type",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "record",
          "name",
          "type",
          "ttl",
          "status",
          "value"
        ],
        "title": "DnsRecordOut",
        "type": "object"
      },
      "DomainCreate": {
        "properties": {
          "domain": {
            "description": "Custom domain name (e.g. mail.mattsplumbing.com.au)",
            "maxLength": 255,
            "minLength": 3,
            "title": "Domain",
            "type": "string"
          },
          "from_email": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Email prefix (e.g. 'noreply')",
            "title": "From Email"
          },
          "from_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name in From: header",
            "title": "From Name"
          },
          "region": {
            "default": "us-east-1",
            "description": "Resend region for email delivery",
            "title": "Region",
            "type": "string"
          }
        },
        "required": [
          "domain"
        ],
        "title": "DomainCreate",
        "type": "object"
      },
      "DomainOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "dns_records": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DnsRecordOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dns Records"
          },
          "domain": {
            "title": "Domain",
            "type": "string"
          },
          "from_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Email"
          },
          "from_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Name"
          },
          "full_from_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full From Address"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "region": {
            "title": "Region",
            "type": "string"
          },
          "resend_domain_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resend Domain Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          }
        },
        "required": [
          "id",
          "domain",
          "status",
          "region",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "DomainOut",
        "type": "object"
      },
      "DomainRecordsOut": {
        "description": "DNS records required for custom domain setup.",
        "properties": {
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "records": {
            "default": [],
            "items": {
              "type": "object"
            },
            "title": "Records",
            "type": "array"
          },
          "verified": {
            "default": false,
            "title": "Verified",
            "type": "boolean"
          }
        },
        "title": "DomainRecordsOut",
        "type": "object"
      },
      "DomainResolveOut": {
        "properties": {
          "customer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Email"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "DomainResolveOut",
        "type": "object"
      },
      "DomainUpdate": {
        "properties": {
          "from_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Email"
          },
          "from_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Name"
          }
        },
        "title": "DomainUpdate",
        "type": "object"
      },
      "EarlyDiagnosticRequest": {
        "description": "Pre-mTLS diagnostic breadcrumb from bootstrap-agent.sh.\n\nAuths via the per-instance bootstrap_token (already in the\nscript's env from cloud-init Jinja templating, valid before\nPhase 1 cert exchange). This is the only way to get a phase-by-\nphase trace from bootstrap-agent before mTLS is established \u2014\nevery regular /callback or /diagnostic request requires the\ncallback_jwt that's only minted at Phase 2.\n\nKept narrow: log message body only, no other side effects.\nThe bootstrap_token is one-shot and consumed at /secrets, but\nmultiple early-diagnostic calls before /secrets are fine\nbecause we only USE the token for hash compare, not consume.",
        "properties": {
          "bootstrap_token": {
            "maxLength": 200,
            "minLength": 10,
            "title": "Bootstrap Token",
            "type": "string"
          },
          "instance_id": {
            "maxLength": 80,
            "minLength": 1,
            "title": "Instance Id",
            "type": "string"
          },
          "label": {
            "maxLength": 80,
            "minLength": 1,
            "title": "Label",
            "type": "string"
          },
          "level": {
            "default": "info",
            "pattern": "^(info|warn|error)$",
            "title": "Level",
            "type": "string"
          },
          "message": {
            "maxLength": 2000,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "bootstrap_token",
          "label",
          "message"
        ],
        "title": "EarlyDiagnosticRequest",
        "type": "object"
      },
      "EligibilityResponse": {
        "properties": {
          "eligible": {
            "title": "Eligible",
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "eligible"
        ],
        "title": "EligibilityResponse",
        "type": "object"
      },
      "EmbeddedSignupCompleteResponse": {
        "properties": {
          "display_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Phone"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "phone_number_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number Id"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "waba_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Waba Id"
          }
        },
        "required": [
          "success",
          "instance_id"
        ],
        "title": "EmbeddedSignupCompleteResponse",
        "type": "object"
      },
      "EmbeddedSignupInitResponse": {
        "properties": {
          "oauth_url": {
            "title": "Oauth Url",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "oauth_url",
          "state"
        ],
        "title": "EmbeddedSignupInitResponse",
        "type": "object"
      },
      "EndUserTokenRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "person_id": {
            "format": "uuid",
            "title": "Person Id",
            "type": "string"
          }
        },
        "required": [
          "person_id",
          "customer_id"
        ],
        "title": "EndUserTokenRequest",
        "type": "object"
      },
      "EvaluationCreate": {
        "properties": {
          "config": {
            "default": {},
            "title": "Config",
            "type": "object"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "recipe_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipe Id"
          }
        },
        "required": [
          "name"
        ],
        "title": "EvaluationCreate",
        "type": "object"
      },
      "EvaluationOut": {
        "properties": {
          "config": {
            "title": "Config",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "recipe_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipe Id"
          },
          "results_summary": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Results Summary"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "description",
          "recipe_id",
          "instance_id",
          "status",
          "config",
          "results_summary",
          "created_at",
          "updated_at"
        ],
        "title": "EvaluationOut",
        "type": "object"
      },
      "ExecuteOut": {
        "properties": {
          "data": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "title": "ExecuteOut",
        "type": "object"
      },
      "ExecuteRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "params": {
            "title": "Params",
            "type": "object"
          },
          "provider_slug": {
            "maxLength": 50,
            "title": "Provider Slug",
            "type": "string"
          },
          "tool_name": {
            "maxLength": 200,
            "title": "Tool Name",
            "type": "string"
          }
        },
        "required": [
          "tool_name",
          "provider_slug",
          "customer_id"
        ],
        "title": "ExecuteRequest",
        "type": "object"
      },
      "FleetConversationRow": {
        "description": "Single conversation in the fleet-level list.",
        "properties": {
          "conversation_id": {
            "title": "Conversation Id",
            "type": "string"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "last_message_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Message At"
          },
          "message_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message Count"
          },
          "participant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Participant"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          }
        },
        "required": [
          "instance_id",
          "hostname",
          "conversation_id"
        ],
        "title": "FleetConversationRow",
        "type": "object"
      },
      "FleetConversationsOut": {
        "description": "Paginated fleet-level conversation list.",
        "properties": {
          "conversations": {
            "items": {
              "$ref": "#/components/schemas/FleetConversationRow"
            },
            "title": "Conversations",
            "type": "array"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "conversations",
          "total"
        ],
        "title": "FleetConversationsOut",
        "type": "object"
      },
      "FleetInboxOut": {
        "description": "Fleet-wide conversation inbox overview.",
        "properties": {
          "consented_instances": {
            "title": "Consented Instances",
            "type": "integer"
          },
          "instances": {
            "items": {
              "$ref": "#/components/schemas/FleetInstanceSummary"
            },
            "title": "Instances",
            "type": "array"
          },
          "total_conversations": {
            "title": "Total Conversations",
            "type": "integer"
          },
          "total_instances": {
            "title": "Total Instances",
            "type": "integer"
          }
        },
        "required": [
          "instances",
          "total_instances",
          "consented_instances",
          "total_conversations"
        ],
        "title": "FleetInboxOut",
        "type": "object"
      },
      "FleetInstanceSummary": {
        "description": "Per-instance summary in the fleet inbox overview.",
        "properties": {
          "consent_debug_access": {
            "title": "Consent Debug Access",
            "type": "boolean"
          },
          "conversation_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Count"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "latest_conversation_ts": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Conversation Ts"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "hostname",
          "status",
          "consent_debug_access"
        ],
        "title": "FleetInstanceSummary",
        "type": "object"
      },
      "FleetRolloutResponse": {
        "properties": {
          "enqueued": {
            "title": "Enqueued",
            "type": "integer"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "skipped": {
            "title": "Skipped",
            "type": "integer"
          },
          "tasks": {
            "items": {
              "type": "object"
            },
            "title": "Tasks",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "enqueued",
          "skipped",
          "tasks",
          "message"
        ],
        "title": "FleetRolloutResponse",
        "type": "object"
      },
      "FlowCreate": {
        "properties": {
          "compliance_rules": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Rules"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "maxLength": 100,
            "title": "Slug",
            "type": "string"
          },
          "stages": {
            "items": {
              "type": "object"
            },
            "title": "Stages",
            "type": "array"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "title": "FlowCreate",
        "type": "object"
      },
      "FlowOut": {
        "properties": {
          "compliance_rules": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Rules"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "stages": {
            "items": {},
            "title": "Stages",
            "type": "array"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "slug",
          "name",
          "description",
          "stages",
          "compliance_rules",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "FlowOut",
        "type": "object"
      },
      "FlowUpdate": {
        "properties": {
          "compliance_rules": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Rules"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "stages": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stages"
          }
        },
        "title": "FlowUpdate",
        "type": "object"
      },
      "ForgotPasswordRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "ForgotPasswordRequest",
        "type": "object"
      },
      "FormCreate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "entity_definition_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Definition Id"
          },
          "form_config": {
            "title": "Form Config",
            "type": "object"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "maxLength": 100,
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "default": "active",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "title": "FormCreate",
        "type": "object"
      },
      "FormOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "entity_definition_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Definition Id"
          },
          "form_config": {
            "title": "Form Config",
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "slug",
          "name",
          "description",
          "entity_definition_id",
          "form_config",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "FormOut",
        "type": "object"
      },
      "FormStatsOut": {
        "properties": {
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "unread": {
            "title": "Unread",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "unread"
        ],
        "title": "FormStatsOut",
        "type": "object"
      },
      "FormSubmissionOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "form_data": {
            "title": "Form Data",
            "type": "object"
          },
          "hosted_website_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosted Website Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_read": {
            "title": "Is Read",
            "type": "boolean"
          },
          "page_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Slug"
          },
          "submitter_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitter Email"
          },
          "website_config_id": {
            "format": "uuid",
            "title": "Website Config Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "website_config_id",
          "form_data",
          "is_read",
          "created_at"
        ],
        "title": "FormSubmissionOut",
        "type": "object"
      },
      "FormSubmissionStats": {
        "properties": {
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "unread": {
            "title": "Unread",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "unread"
        ],
        "title": "FormSubmissionStats",
        "type": "object"
      },
      "FormSubmitRequest": {
        "properties": {
          "email": {
            "anyOf": [
              {
                "maxLength": 320,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "form_data": {
            "maxProperties": 50,
            "title": "Form Data",
            "type": "object"
          },
          "page_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Slug"
          },
          "site_id": {
            "format": "uuid",
            "title": "Site Id",
            "type": "string"
          }
        },
        "required": [
          "site_id",
          "form_data"
        ],
        "title": "FormSubmitRequest",
        "type": "object"
      },
      "FormSubmitResponse": {
        "properties": {
          "status": {
            "default": "received",
            "title": "Status",
            "type": "string"
          },
          "submission_id": {
            "format": "uuid",
            "title": "Submission Id",
            "type": "string"
          }
        },
        "required": [
          "submission_id"
        ],
        "title": "FormSubmitResponse",
        "type": "object"
      },
      "FormUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "entity_definition_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Definition Id"
          },
          "form_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Form Config"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "FormUpdate",
        "type": "object"
      },
      "FreeBusyOut": {
        "properties": {
          "busy_periods": {
            "items": {
              "type": "object"
            },
            "title": "Busy Periods",
            "type": "array"
          },
          "calendar_id": {
            "title": "Calendar Id",
            "type": "string"
          }
        },
        "required": [
          "busy_periods",
          "calendar_id"
        ],
        "title": "FreeBusyOut",
        "type": "object"
      },
      "GmailSendRequest": {
        "properties": {
          "bcc": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bcc"
          },
          "body": {
            "description": "Email body (plain text)",
            "title": "Body",
            "type": "string"
          },
          "body_html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Email body (HTML, optional)",
            "title": "Body Html"
          },
          "cc": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cc"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Specific Gmail connection (for multi-account)",
            "title": "Connection Name"
          },
          "reply_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "In-Reply-To message ID for threading",
            "title": "Reply To"
          },
          "subject": {
            "maxLength": 500,
            "title": "Subject",
            "type": "string"
          },
          "to": {
            "description": "Recipient email address",
            "title": "To",
            "type": "string"
          }
        },
        "required": [
          "to",
          "subject",
          "body"
        ],
        "title": "GmailSendRequest",
        "type": "object"
      },
      "GmailSendResponse": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message Id"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "thread_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thread Id"
          }
        },
        "required": [
          "success"
        ],
        "title": "GmailSendResponse",
        "type": "object"
      },
      "GoogleOAuthCompleteResponse": {
        "properties": {
          "connections_created": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Connections Created",
            "type": "array"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "provider": {
            "default": "google",
            "title": "Provider",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "customer_id"
        ],
        "title": "GoogleOAuthCompleteResponse",
        "type": "object"
      },
      "GoogleOAuthInitResponse": {
        "properties": {
          "oauth_url": {
            "title": "Oauth Url",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "oauth_url",
          "state"
        ],
        "title": "GoogleOAuthInitResponse",
        "type": "object"
      },
      "GrantCreate": {
        "properties": {
          "capabilities": {
            "description": "Provider-specific capabilities (e.g. send_mail, read_events)",
            "items": {
              "type": "string"
            },
            "title": "Capabilities",
            "type": "array"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "capabilities"
        ],
        "title": "GrantCreate",
        "type": "object"
      },
      "GrantRequest": {
        "properties": {
          "duration_hours": {
            "maximum": 168.0,
            "minimum": 1.0,
            "title": "Duration Hours",
            "type": "integer"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "instance_id",
          "duration_hours"
        ],
        "title": "GrantRequest",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HostedWebsiteCreate": {
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "dedicated_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedicated Instance Id"
          },
          "hosting_mode": {
            "pattern": "^(dedicated|shared)$",
            "title": "Hosting Mode",
            "type": "string"
          },
          "name": {
            "maxLength": 160,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "primary_domain": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Domain"
          },
          "webhost_node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhost Node Id"
          },
          "website_config_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Website Config Id"
          }
        },
        "required": [
          "hosting_mode",
          "name"
        ],
        "title": "HostedWebsiteCreate",
        "type": "object"
      },
      "HostedWebsiteDeployResponse": {
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          },
          "website_id": {
            "format": "uuid",
            "title": "Website Id",
            "type": "string"
          }
        },
        "required": [
          "website_id",
          "status",
          "message"
        ],
        "title": "HostedWebsiteDeployResponse",
        "type": "object"
      },
      "HostedWebsiteMigrateRequest": {
        "properties": {
          "dedicated_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedicated Instance Id"
          },
          "primary_domain": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Domain"
          },
          "target_mode": {
            "pattern": "^(shared|dedicated)$",
            "title": "Target Mode",
            "type": "string"
          },
          "webhost_node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhost Node Id"
          }
        },
        "required": [
          "target_mode"
        ],
        "title": "HostedWebsiteMigrateRequest",
        "type": "object"
      },
      "HostedWebsiteOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current_commit_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Commit Sha"
          },
          "current_release_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Release Id"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "dedicated_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedicated Instance Id"
          },
          "deployed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed At"
          },
          "hosting_mode": {
            "title": "Hosting Mode",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "metadata_json": {
            "title": "Metadata Json",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "primary_domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Domain"
          },
          "repo_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Path"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "webhost_node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhost Node Id"
          },
          "website_config_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Website Config Id"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "hosting_mode",
          "name",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "HostedWebsiteOut",
        "type": "object"
      },
      "HostedWebsiteUpdate": {
        "properties": {
          "dedicated_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedicated Instance Id"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 160,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "primary_domain": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Domain"
          },
          "status": {
            "anyOf": [
              {
                "pattern": "^(draft|deploying|live|migrating|error|archived)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "webhost_node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhost Node Id"
          }
        },
        "title": "HostedWebsiteUpdate",
        "type": "object"
      },
      "IdentityCreate": {
        "properties": {
          "channel": {
            "description": "Channel type: telegram, whatsapp, slack, etc.",
            "title": "Channel",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "external_id": {
            "description": "External ID (chat_id, phone, etc.)",
            "maxLength": 255,
            "minLength": 1,
            "title": "External Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: scope to a specific instance",
            "title": "Instance Id"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "role_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Override channel default role: 'owner' for elevated access, null for default",
            "title": "Role Override"
          }
        },
        "required": [
          "channel",
          "external_id"
        ],
        "title": "IdentityCreate",
        "type": "object"
      },
      "IdentityOut": {
        "properties": {
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "role_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role Override"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "verified": {
            "title": "Verified",
            "type": "boolean"
          },
          "verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          }
        },
        "required": [
          "id",
          "customer_id",
          "channel",
          "external_id",
          "verified",
          "created_at",
          "updated_at"
        ],
        "title": "IdentityOut",
        "type": "object"
      },
      "IdentityUpdate": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "role_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role Override"
          },
          "verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified"
          }
        },
        "title": "IdentityUpdate",
        "type": "object"
      },
      "ImportResult": {
        "properties": {
          "errors": {
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          },
          "imported": {
            "title": "Imported",
            "type": "integer"
          },
          "skipped": {
            "title": "Skipped",
            "type": "integer"
          }
        },
        "required": [
          "imported",
          "skipped",
          "errors"
        ],
        "title": "ImportResult",
        "type": "object"
      },
      "InboxCreate": {
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "domain_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom domain ID (uses verified domain instead of default)",
            "title": "Domain Id"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "is_default": {
            "default": false,
            "title": "Is Default",
            "type": "boolean"
          },
          "rate_limit_per_day": {
            "default": 2000,
            "maximum": 50000.0,
            "minimum": 1.0,
            "title": "Rate Limit Per Day",
            "type": "integer"
          },
          "rate_limit_per_hour": {
            "default": 250,
            "maximum": 5000.0,
            "minimum": 1.0,
            "title": "Rate Limit Per Hour",
            "type": "integer"
          },
          "rate_limit_per_minute": {
            "default": 10,
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Rate Limit Per Minute",
            "type": "integer"
          },
          "username": {
            "maxLength": 100,
            "pattern": "^[a-z0-9][a-z0-9._-]*$",
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "username"
        ],
        "title": "InboxCreate",
        "type": "object"
      },
      "InboxOut": {
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "domain": {
            "title": "Domain",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_default": {
            "title": "Is Default",
            "type": "boolean"
          },
          "rate_limit_per_day": {
            "title": "Rate Limit Per Day",
            "type": "integer"
          },
          "rate_limit_per_hour": {
            "title": "Rate Limit Per Hour",
            "type": "integer"
          },
          "rate_limit_per_minute": {
            "title": "Rate Limit Per Minute",
            "type": "integer"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "username": {
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "customer_id",
          "instance_id",
          "address",
          "username",
          "domain",
          "display_name",
          "is_default",
          "is_active",
          "rate_limit_per_minute",
          "rate_limit_per_hour",
          "rate_limit_per_day",
          "created_at"
        ],
        "title": "InboxOut",
        "type": "object"
      },
      "IngestResponse": {
        "properties": {
          "chunks_created": {
            "title": "Chunks Created",
            "type": "integer"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          },
          "tokens_embedded": {
            "title": "Tokens Embedded",
            "type": "integer"
          }
        },
        "required": [
          "chunks_created",
          "tokens_embedded",
          "source_id"
        ],
        "title": "IngestResponse",
        "type": "object"
      },
      "IngestTextRequest": {
        "properties": {
          "chunk_overlap": {
            "default": 200,
            "maximum": 1000.0,
            "minimum": 0.0,
            "title": "Chunk Overlap",
            "type": "integer"
          },
          "chunk_size": {
            "default": 1500,
            "maximum": 5000.0,
            "minimum": 200.0,
            "title": "Chunk Size",
            "type": "integer"
          },
          "content": {
            "description": "Text content to ingest",
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "source_id": {
            "description": "Source identifier (file path, URL, etc.)",
            "maxLength": 500,
            "title": "Source Id",
            "type": "string"
          },
          "source_name": {
            "description": "Human-readable source name",
            "maxLength": 500,
            "title": "Source Name",
            "type": "string"
          },
          "source_type": {
            "default": "r2",
            "description": "Source type: r2, drive, web, sheet, email",
            "title": "Source Type",
            "type": "string"
          }
        },
        "required": [
          "source_id",
          "source_name",
          "content"
        ],
        "title": "IngestTextRequest",
        "type": "object"
      },
      "InitiateRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "flow_id": {
            "format": "uuid",
            "title": "Flow Id",
            "type": "string"
          },
          "initiated_via": {
            "default": "agent",
            "title": "Initiated Via",
            "type": "string"
          },
          "person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Person Id"
          }
        },
        "required": [
          "flow_id",
          "customer_id"
        ],
        "title": "InitiateRequest",
        "type": "object"
      },
      "InstanceDetail": {
        "properties": {
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "callback_seq": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Seq"
          },
          "callback_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Stage"
          },
          "capabilities": {
            "additionalProperties": {
              "type": "boolean"
            },
            "title": "Capabilities",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "health_status": {
            "title": "Health Status",
            "type": "string"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          },
          "preset_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preset Id"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "provisioning_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provisioning Stage"
          },
          "region_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region Id"
          },
          "runtime_type": {
            "default": "expressclaw",
            "title": "Runtime Type",
            "type": "string"
          },
          "server_type_plan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Type Plan"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "vpn_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vpn Ip"
          },
          "workload_type": {
            "default": "agent",
            "title": "Workload Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "hostname",
          "status",
          "ip_address",
          "vpn_ip",
          "region_id",
          "provider",
          "server_type_plan",
          "health_status",
          "provisioning_stage",
          "error_message",
          "created_at",
          "updated_at"
        ],
        "title": "InstanceDetail",
        "type": "object"
      },
      "InstanceListResponse": {
        "properties": {
          "instances": {
            "items": {
              "$ref": "#/components/schemas/InstanceSummary"
            },
            "title": "Instances",
            "type": "array"
          }
        },
        "required": [
          "instances"
        ],
        "title": "InstanceListResponse",
        "type": "object"
      },
      "InstanceLogsResponse": {
        "description": "Provision logs for an instance.",
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "logs": {
            "items": {
              "$ref": "#/components/schemas/LogEntry"
            },
            "title": "Logs",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "instance_id",
          "logs",
          "total"
        ],
        "title": "InstanceLogsResponse",
        "type": "object"
      },
      "InstanceMemoryClearResponse": {
        "properties": {
          "deleted": {
            "title": "Deleted",
            "type": "integer"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "deleted",
          "status"
        ],
        "title": "InstanceMemoryClearResponse",
        "type": "object"
      },
      "InstanceMemoryResponse": {
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "memories": {
            "items": {
              "type": "object"
            },
            "title": "Memories",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "object"
          }
        },
        "required": [
          "instance_id",
          "count",
          "memories"
        ],
        "title": "InstanceMemoryResponse",
        "type": "object"
      },
      "InstanceMemoryStoreResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "memory": {
            "title": "Memory",
            "type": "object"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "status"
        ],
        "title": "InstanceMemoryStoreResponse",
        "type": "object"
      },
      "InstanceOut": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Stage"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "flow_id": {
            "format": "uuid",
            "title": "Flow Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Person Id"
          },
          "refresh_schedule_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Schedule Id"
          },
          "stage_statuses": {
            "title": "Stage Statuses",
            "type": "object"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "flow_id",
          "customer_id",
          "person_id",
          "current_stage",
          "stage_statuses",
          "status",
          "refresh_schedule_id",
          "started_at",
          "completed_at",
          "created_at"
        ],
        "title": "InstanceOut",
        "type": "object"
      },
      "InstanceSkillOut": {
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "installed_at": {
            "format": "date-time",
            "title": "Installed At",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "skill_emoji": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Emoji"
          },
          "skill_id": {
            "format": "uuid",
            "title": "Skill Id",
            "type": "string"
          },
          "skill_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Name"
          },
          "skill_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Slug"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "id",
          "instance_id",
          "skill_id",
          "status",
          "installed_at"
        ],
        "title": "InstanceSkillOut",
        "type": "object"
      },
      "InstanceSummary": {
        "properties": {
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Email"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          },
          "preset_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preset Id"
          },
          "product_tier_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Tier Name"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "region_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region Id"
          },
          "runtime_type": {
            "default": "expressclaw",
            "title": "Runtime Type",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "workload_type": {
            "default": "agent",
            "title": "Workload Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "hostname",
          "status",
          "ip_address",
          "region_id",
          "provider",
          "created_at"
        ],
        "title": "InstanceSummary",
        "type": "object"
      },
      "InstanceUsageRow": {
        "description": "Per-instance usage stats.",
        "properties": {
          "estimated_cost_usd": {
            "title": "Estimated Cost Usd",
            "type": "string"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "request_count": {
            "title": "Request Count",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "instance_id",
          "hostname",
          "status",
          "request_count",
          "total_tokens",
          "estimated_cost_usd"
        ],
        "title": "InstanceUsageRow",
        "type": "object"
      },
      "IntegrationOut": {
        "properties": {
          "auth_type": {
            "title": "Auth Type",
            "type": "string"
          },
          "capability_flag": {
            "title": "Capability Flag",
            "type": "string"
          },
          "category": {
            "title": "Category",
            "type": "string"
          },
          "fallback_message": {
            "title": "Fallback Message",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "required_by_presets": {
            "items": {
              "type": "string"
            },
            "title": "Required By Presets",
            "type": "array"
          },
          "used_by_presets": {
            "items": {
              "type": "string"
            },
            "title": "Used By Presets",
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "capability_flag",
          "auth_type",
          "category",
          "used_by_presets",
          "required_by_presets",
          "fallback_message"
        ],
        "title": "IntegrationOut",
        "type": "object"
      },
      "InvitationAcceptRequest": {
        "properties": {
          "token": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "title": "InvitationAcceptRequest",
        "type": "object"
      },
      "InvitationCreate": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "role": {
            "default": "member",
            "description": "Team role for the invitee",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "InvitationCreate",
        "type": "object"
      },
      "InvitationOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invited_by": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By"
          },
          "invited_by_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By Email"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "status",
          "expires_at",
          "created_at"
        ],
        "title": "InvitationOut",
        "type": "object"
      },
      "InvoiceCreate": {
        "properties": {
          "client_email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Email"
          },
          "client_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due Date"
          },
          "invoice_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Number"
          },
          "line_items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LineItemInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Line Items"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "InvoiceCreate",
        "type": "object"
      },
      "InvoiceUpdate": {
        "properties": {
          "client_email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Email"
          },
          "client_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due Date"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of: ('draft', 'sent', 'paid', 'overdue', 'void')",
            "title": "Status"
          },
          "xero_invoice_id": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xero Invoice Id"
          }
        },
        "title": "InvoiceUpdate",
        "type": "object"
      },
      "JobCreate": {
        "properties": {
          "client_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "job_ref": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Ref"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "requirements": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirements"
          },
          "scheduled_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Date"
          },
          "site": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "title": {
            "maxLength": 500,
            "title": "Title",
            "type": "string"
          },
          "work_type": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Work Type"
          }
        },
        "required": [
          "customer_id",
          "title"
        ],
        "title": "JobCreate",
        "type": "object"
      },
      "JobOut": {
        "properties": {
          "client_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "completed_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed Date"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "job_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Ref"
          },
          "requirements": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirements"
          },
          "scheduled_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Date"
          },
          "site": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "work_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Work Type"
          }
        },
        "required": [
          "id",
          "customer_id",
          "title",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "JobOut",
        "type": "object"
      },
      "JobUpdate": {
        "properties": {
          "client_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "requirements": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirements"
          },
          "site": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "work_type": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Work Type"
          }
        },
        "title": "JobUpdate",
        "type": "object"
      },
      "KVBatchSet": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "entries": {
            "description": "List of {key, value, expires_at?}",
            "items": {
              "type": "object"
            },
            "title": "Entries",
            "type": "array"
          },
          "namespace": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Namespace",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "namespace",
          "entries"
        ],
        "title": "KVBatchSet",
        "type": "object"
      },
      "KVSet": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "key": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Key",
            "type": "string"
          },
          "namespace": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Namespace",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "object"
          }
        },
        "required": [
          "customer_id",
          "namespace",
          "key",
          "value"
        ],
        "title": "KVSet",
        "type": "object"
      },
      "LineItemInput": {
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "title": "Description",
            "type": "string"
          },
          "quantity": {
            "default": 1.0,
            "exclusiveMinimum": 0.0,
            "title": "Quantity",
            "type": "number"
          },
          "unit_price": {
            "title": "Unit Price",
            "type": "number"
          }
        },
        "required": [
          "description",
          "unit_price"
        ],
        "title": "LineItemInput",
        "type": "object"
      },
      "ListResponse": {
        "properties": {
          "images": {
            "items": {
              "$ref": "#/components/schemas/RuntimeImageOut"
            },
            "title": "Images",
            "type": "array"
          }
        },
        "required": [
          "images"
        ],
        "title": "ListResponse",
        "type": "object"
      },
      "LiveMigrateRequest": {
        "properties": {
          "target_node_id": {
            "format": "uuid",
            "title": "Target Node Id",
            "type": "string"
          }
        },
        "required": [
          "target_node_id"
        ],
        "title": "LiveMigrateRequest",
        "type": "object"
      },
      "LlmEventsResponse": {
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "title": "Providers",
            "type": "array"
          },
          "window_seconds": {
            "title": "Window Seconds",
            "type": "integer"
          }
        },
        "required": [
          "instance_id",
          "window_seconds",
          "count",
          "providers"
        ],
        "title": "LlmEventsResponse",
        "type": "object"
      },
      "LogEntry": {
        "description": "Single provision log entry.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "level": {
            "title": "Level",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "seq": {
            "title": "Seq",
            "type": "integer"
          },
          "stage": {
            "title": "Stage",
            "type": "string"
          }
        },
        "required": [
          "seq",
          "level",
          "stage",
          "message",
          "created_at"
        ],
        "title": "LogEntry",
        "type": "object"
      },
      "LogEntryOut": {
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "customer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Name"
          },
          "detail": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "instance_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Name"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "timestamp": {
            "title": "Timestamp",
            "type": "string"
          }
        },
        "required": [
          "id",
          "timestamp",
          "instance_id",
          "instance_name",
          "customer_id",
          "customer_name",
          "event_type",
          "severity",
          "message"
        ],
        "title": "LogEntryOut",
        "type": "object"
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "password": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest",
        "type": "object"
      },
      "LogsListResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "logs": {
            "items": {
              "$ref": "#/components/schemas/LogEntryOut"
            },
            "title": "Logs",
            "type": "array"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "logs",
          "total",
          "limit",
          "offset"
        ],
        "title": "LogsListResponse",
        "type": "object"
      },
      "MCPCallLogIn": {
        "additionalProperties": false,
        "description": "Fields the MCP server is allowed to send. Server-side stamping\nfills in the identity columns (api_key_id, user_id, tenant_id,\ncustomer_id, scope_kind) \u2014 never trust these from the wire.",
        "properties": {
          "error_class": {
            "anyOf": [
              {
                "maxLength": 64,
                "pattern": "^[A-Za-z][A-Za-z0-9_.]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Class"
          },
          "http_status": {
            "anyOf": [
              {
                "maximum": 599.0,
                "minimum": 100.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "latency_ms": {
            "anyOf": [
              {
                "maximum": 600000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "request_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_\\-.:]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "scope_tag": {
            "anyOf": [
              {
                "maxLength": 64,
                "pattern": "^[a-z][a-z\\-]*:[a-z]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope Tag"
          },
          "status": {
            "enum": [
              "allow",
              "deny_scope",
              "deny_jwt_only",
              "upstream_4xx",
              "upstream_5xx",
              "network_error",
              "exception"
            ],
            "title": "Status",
            "type": "string"
          },
          "tool_name": {
            "maxLength": 64,
            "pattern": "^[a-z][a-z0-9_]+$",
            "title": "Tool Name",
            "type": "string"
          }
        },
        "required": [
          "tool_name",
          "status"
        ],
        "title": "MCPCallLogIn",
        "type": "object"
      },
      "MCPCredentialListItem": {
        "description": "Summary of stored credentials (no plaintext).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "env_var_names": {
            "items": {
              "type": "string"
            },
            "title": "Env Var Names",
            "type": "array"
          },
          "server_slug": {
            "title": "Server Slug",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "server_slug",
          "env_var_names",
          "created_at",
          "updated_at"
        ],
        "title": "MCPCredentialListItem",
        "type": "object"
      },
      "MCPCredentialListResponse": {
        "description": "List of all MCP credentials for an instance.",
        "properties": {
          "credentials": {
            "items": {
              "$ref": "#/components/schemas/MCPCredentialListItem"
            },
            "title": "Credentials",
            "type": "array"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "credentials"
        ],
        "title": "MCPCredentialListResponse",
        "type": "object"
      },
      "MCPCredentialResponse": {
        "description": "Decrypted credentials returned to agent runtime.",
        "properties": {
          "credentials": {
            "title": "Credentials",
            "type": "object"
          },
          "issued_at": {
            "title": "Issued At",
            "type": "string"
          },
          "server_slug": {
            "title": "Server Slug",
            "type": "string"
          }
        },
        "required": [
          "server_slug",
          "credentials",
          "issued_at"
        ],
        "title": "MCPCredentialResponse",
        "type": "object"
      },
      "MCPCredentialSetRequest": {
        "description": "Admin request to set MCP credentials for a server.",
        "properties": {
          "credentials": {
            "description": "Dict of env vars to inject, e.g. {'XERO_CLIENT_ID': '...', 'XERO_CLIENT_SECRET': '...'}",
            "minProperties": 1,
            "title": "Credentials",
            "type": "object"
          }
        },
        "required": [
          "credentials"
        ],
        "title": "MCPCredentialSetRequest",
        "type": "object"
      },
      "MediaOut": {
        "properties": {
          "alt_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alt Text"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "metadata_json": {
            "default": {},
            "title": "Metadata Json",
            "type": "object"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "variants": {
            "default": {},
            "title": "Variants",
            "type": "object"
          },
          "website_config_id": {
            "format": "uuid",
            "title": "Website Config Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "website_config_id",
          "filename",
          "content_type",
          "size_bytes",
          "created_at"
        ],
        "title": "MediaOut",
        "type": "object"
      },
      "MediaUploadRequest": {
        "properties": {
          "content_type": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "content_type"
        ],
        "title": "MediaUploadRequest",
        "type": "object"
      },
      "MediaUploadUrlRequest": {
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "maxLength": 255,
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "content_type"
        ],
        "title": "MediaUploadUrlRequest",
        "type": "object"
      },
      "MergedConfigOut": {
        "properties": {
          "config": {
            "title": "Config",
            "type": "object"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "customer_id",
          "config"
        ],
        "title": "MergedConfigOut",
        "type": "object"
      },
      "MetricsSummaryOut": {
        "description": "High-level usage summary for the selected period.",
        "properties": {
          "active_instances": {
            "title": "Active Instances",
            "type": "integer"
          },
          "estimated_cost_usd": {
            "title": "Estimated Cost Usd",
            "type": "string"
          },
          "period_days": {
            "title": "Period Days",
            "type": "integer"
          },
          "total_requests": {
            "title": "Total Requests",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "total_tokens_in": {
            "title": "Total Tokens In",
            "type": "integer"
          },
          "total_tokens_out": {
            "title": "Total Tokens Out",
            "type": "integer"
          },
          "unique_models": {
            "title": "Unique Models",
            "type": "integer"
          }
        },
        "required": [
          "total_requests",
          "total_tokens_in",
          "total_tokens_out",
          "total_tokens",
          "estimated_cost_usd",
          "active_instances",
          "unique_models",
          "period_days"
        ],
        "title": "MetricsSummaryOut",
        "type": "object"
      },
      "MicrosoftOAuthCompleteResponse": {
        "properties": {
          "connections_created": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Connections Created",
            "type": "array"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "provider": {
            "default": "microsoft_graph",
            "title": "Provider",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "customer_id"
        ],
        "title": "MicrosoftOAuthCompleteResponse",
        "type": "object"
      },
      "MicrosoftOAuthInitResponse": {
        "properties": {
          "oauth_url": {
            "title": "Oauth Url",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "oauth_url",
          "state"
        ],
        "title": "MicrosoftOAuthInitResponse",
        "type": "object"
      },
      "ModelAvailabilityResponse": {
        "properties": {
          "providers": {
            "items": {
              "$ref": "#/components/schemas/ProviderAvailability"
            },
            "title": "Providers",
            "type": "array"
          }
        },
        "required": [
          "providers"
        ],
        "title": "ModelAvailabilityResponse",
        "type": "object"
      },
      "ModelBreakdownOut": {
        "description": "Model usage breakdown.\n\n\"Hasta la vista, baby.\" \u2014 T-800\n(to the models you'll stop using after seeing these numbers)",
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/ModelBreakdownRow"
            },
            "title": "Models",
            "type": "array"
          },
          "total_requests": {
            "title": "Total Requests",
            "type": "integer"
          }
        },
        "required": [
          "models",
          "total_requests"
        ],
        "title": "ModelBreakdownOut",
        "type": "object"
      },
      "ModelBreakdownRow": {
        "description": "Per-model usage stats \u2014 who's hogging the tokens.",
        "properties": {
          "estimated_cost_usd": {
            "title": "Estimated Cost Usd",
            "type": "string"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "pct_of_total": {
            "title": "Pct Of Total",
            "type": "number"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "request_count": {
            "title": "Request Count",
            "type": "integer"
          },
          "tokens_in": {
            "title": "Tokens In",
            "type": "integer"
          },
          "tokens_out": {
            "title": "Tokens Out",
            "type": "integer"
          }
        },
        "required": [
          "provider",
          "model",
          "request_count",
          "tokens_in",
          "tokens_out",
          "estimated_cost_usd",
          "pct_of_total"
        ],
        "title": "ModelBreakdownRow",
        "type": "object"
      },
      "ModelCatalogCreate": {
        "properties": {
          "api_base_url": {
            "maxLength": 500,
            "title": "Api Base Url",
            "type": "string"
          },
          "api_format": {
            "maxLength": 20,
            "title": "Api Format",
            "type": "string"
          },
          "capabilities": {
            "items": {},
            "title": "Capabilities",
            "type": "array"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "cost_batch_input_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Batch Input Per Mtok"
          },
          "cost_batch_output_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Batch Output Per Mtok"
          },
          "cost_cached_input_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Cached Input Per Mtok"
          },
          "cost_input_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Input Per Mtok"
          },
          "cost_output_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Output Per Mtok"
          },
          "display_name": {
            "maxLength": 200,
            "title": "Display Name",
            "type": "string"
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens"
          },
          "modality": {
            "default": "llm",
            "maxLength": 30,
            "title": "Modality",
            "type": "string"
          },
          "model_id": {
            "maxLength": 200,
            "title": "Model Id",
            "type": "string"
          },
          "provider": {
            "maxLength": 50,
            "title": "Provider",
            "type": "string"
          },
          "slug": {
            "maxLength": 100,
            "title": "Slug",
            "type": "string"
          },
          "speed_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Speed Tier"
          },
          "typical_tps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typical Tps"
          },
          "typical_ttft_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typical Ttft Ms"
          }
        },
        "required": [
          "slug",
          "provider",
          "model_id",
          "display_name",
          "api_base_url",
          "api_format"
        ],
        "title": "ModelCatalogCreate",
        "type": "object"
      },
      "ModelCatalogOut": {
        "properties": {
          "api_format": {
            "title": "Api Format",
            "type": "string"
          },
          "capabilities": {
            "items": {},
            "title": "Capabilities",
            "type": "array"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "cost_cached_input_per_mtok": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Cached Input Per Mtok"
          },
          "cost_input_per_mtok": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Input Per Mtok"
          },
          "cost_output_per_mtok": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Output Per Mtok"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_deprecated": {
            "title": "Is Deprecated",
            "type": "boolean"
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens"
          },
          "modality": {
            "title": "Modality",
            "type": "string"
          },
          "model_id": {
            "title": "Model Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "speed_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Speed Tier"
          },
          "typical_tps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typical Tps"
          }
        },
        "required": [
          "id",
          "slug",
          "provider",
          "model_id",
          "display_name",
          "capabilities",
          "modality",
          "api_format",
          "is_active",
          "is_deprecated"
        ],
        "title": "ModelCatalogOut",
        "type": "object"
      },
      "ModelCatalogUpdate": {
        "properties": {
          "cost_cached_input_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Cached Input Per Mtok"
          },
          "cost_input_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Input Per Mtok"
          },
          "cost_output_per_mtok": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Output Per Mtok"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "is_deprecated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Deprecated"
          },
          "speed_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Speed Tier"
          },
          "typical_tps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typical Tps"
          }
        },
        "title": "ModelCatalogUpdate",
        "type": "object"
      },
      "ModelOut": {
        "properties": {
          "capabilities": {
            "items": {
              "type": "string"
            },
            "title": "Capabilities",
            "type": "array"
          },
          "context_window": {
            "title": "Context Window",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "input_cost_per_1m": {
            "title": "Input Cost Per 1M",
            "type": "number"
          },
          "is_default": {
            "title": "Is Default",
            "type": "boolean"
          },
          "max_output_tokens": {
            "title": "Max Output Tokens",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "output_cost_per_1m": {
            "title": "Output Cost Per 1M",
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "context_window",
          "max_output_tokens",
          "input_cost_per_1m",
          "output_cost_per_1m",
          "capabilities",
          "is_default"
        ],
        "title": "ModelOut",
        "type": "object"
      },
      "ModelOverrideCreate": {
        "properties": {
          "budget_daily_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Daily Usd"
          },
          "budget_monthly_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Monthly Usd"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "embedding_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Model"
          },
          "fallback_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Models"
          },
          "max_tokens": {
            "anyOf": [
              {
                "maximum": 200000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "primary_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Model"
          },
          "temperature": {
            "anyOf": [
              {
                "maximum": 2.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          }
        },
        "title": "ModelOverrideCreate",
        "type": "object"
      },
      "ModelOverrideOut": {
        "properties": {
          "budget_daily_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Daily Usd"
          },
          "budget_monthly_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Monthly Usd"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "embedding_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Model"
          },
          "fallback_models": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Models"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "primary_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Model"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "customer_id",
          "primary_model",
          "fallback_models",
          "temperature",
          "max_tokens",
          "budget_daily_usd",
          "budget_monthly_usd",
          "embedding_model",
          "created_at",
          "updated_at"
        ],
        "title": "ModelOverrideOut",
        "type": "object"
      },
      "ModelPolicyResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "model_policy": {
            "title": "Model Policy",
            "type": "object"
          }
        },
        "required": [
          "instance_id",
          "model_policy",
          "message"
        ],
        "title": "ModelPolicyResponse",
        "type": "object"
      },
      "NodeCustomerOut": {
        "properties": {
          "customer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Email"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "customer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Name"
          },
          "placed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Placed At"
          },
          "status": {
            "default": "active",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "NodeCustomerOut",
        "type": "object"
      },
      "OnboardLinkOut": {
        "description": "Stripe Connect onboarding URL.",
        "properties": {
          "account_id": {
            "title": "Account Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "account_id"
        ],
        "title": "OnboardLinkOut",
        "type": "object"
      },
      "OnboardingCompleteResponse": {
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "onboarding_completed": {
            "default": true,
            "title": "Onboarding Completed",
            "type": "boolean"
          }
        },
        "required": [
          "message"
        ],
        "title": "OnboardingCompleteResponse",
        "type": "object"
      },
      "OnboardingOut": {
        "description": "Computed onboarding checklist \u2014 all derived from existing data.",
        "properties": {
          "all_done": {
            "title": "All Done",
            "type": "boolean"
          },
          "completed_count": {
            "title": "Completed Count",
            "type": "integer"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/OnboardingStep"
            },
            "title": "Steps",
            "type": "array"
          },
          "total_count": {
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "steps",
          "completed_count",
          "total_count",
          "all_done"
        ],
        "title": "OnboardingOut",
        "type": "object"
      },
      "OnboardingSetupRequest": {
        "description": "Step 1: Organisation details.",
        "properties": {
          "company_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Company Name",
            "type": "string"
          },
          "industry": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          }
        },
        "required": [
          "company_name"
        ],
        "title": "OnboardingSetupRequest",
        "type": "object"
      },
      "OnboardingStatusResponse": {
        "description": "Current onboarding state for the authenticated user's customer.",
        "properties": {
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "onboarding_completed": {
            "title": "Onboarding Completed",
            "type": "boolean"
          },
          "subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Status"
          },
          "tier_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier Name"
          },
          "trial_ends_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Ends At"
          }
        },
        "required": [
          "onboarding_completed"
        ],
        "title": "OnboardingStatusResponse",
        "type": "object"
      },
      "OnboardingStep": {
        "description": "A single checklist step.",
        "properties": {
          "completed": {
            "title": "Completed",
            "type": "boolean"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "href": {
            "title": "Href",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "key",
          "title",
          "description",
          "completed",
          "href"
        ],
        "title": "OnboardingStep",
        "type": "object"
      },
      "OutboundCallRequest": {
        "properties": {
          "context": {
            "description": "Context for the agent (worker name, shift details, etc.)",
            "title": "Context",
            "type": "object"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "from_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller ID (from channel endpoint)",
            "title": "From Number"
          },
          "max_duration_seconds": {
            "default": 300,
            "maximum": 1800.0,
            "minimum": 30.0,
            "title": "Max Duration Seconds",
            "type": "integer"
          },
          "to_number": {
            "description": "Phone number to call (E.164 format)",
            "title": "To Number",
            "type": "string"
          }
        },
        "required": [
          "to_number"
        ],
        "title": "OutboundCallRequest",
        "type": "object"
      },
      "PageCreate": {
        "properties": {
          "content_html": {
            "default": "",
            "title": "Content Html",
            "type": "string"
          },
          "metadata_json": {
            "default": {},
            "title": "Metadata Json",
            "type": "object"
          },
          "slug": {
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9\\-]*$",
            "title": "Slug",
            "type": "string"
          },
          "sort_order": {
            "default": 0,
            "title": "Sort Order",
            "type": "integer"
          },
          "status": {
            "default": "draft",
            "pattern": "^(draft|published|archived)$",
            "title": "Status",
            "type": "string"
          },
          "title": {
            "maxLength": 300,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "title"
        ],
        "title": "PageCreate",
        "type": "object"
      },
      "PageCreateRequest": {
        "properties": {
          "content_html": {
            "default": "",
            "title": "Content Html",
            "type": "string"
          },
          "slug": {
            "maxLength": 100,
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "default": "draft",
            "title": "Status",
            "type": "string"
          },
          "title": {
            "maxLength": 200,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title",
          "slug"
        ],
        "title": "PageCreateRequest",
        "type": "object"
      },
      "PageOut": {
        "properties": {
          "content_html": {
            "title": "Content Html",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "metadata_json": {
            "default": {},
            "title": "Metadata Json",
            "type": "object"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "sort_order": {
            "default": 0,
            "title": "Sort Order",
            "type": "integer"
          },
          "status": {
            "default": "draft",
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "website_config_id": {
            "format": "uuid",
            "title": "Website Config Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "website_config_id",
          "slug",
          "title",
          "content_html",
          "created_at",
          "updated_at"
        ],
        "title": "PageOut",
        "type": "object"
      },
      "PageUpdate": {
        "properties": {
          "content_html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Html"
          },
          "metadata_json": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata Json"
          },
          "sort_order": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sort Order"
          },
          "status": {
            "anyOf": [
              {
                "pattern": "^(draft|published|archived)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "PageUpdate",
        "type": "object"
      },
      "PageUpdateRequest": {
        "properties": {
          "content_html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Html"
          },
          "published": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "PageUpdateRequest",
        "type": "object"
      },
      "PaginatedList": {
        "properties": {
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "items": {
            "items": {},
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset",
          "has_more"
        ],
        "title": "PaginatedList",
        "type": "object"
      },
      "PatchPlatformConfigRequest": {
        "description": "Partial update \u2014 only provided fields are merged.",
        "properties": {
          "advanced": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Advanced"
          },
          "channels": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channels"
          },
          "integrations": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Integrations"
          },
          "recipe_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipe Id"
          },
          "skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills"
          },
          "workflow_slugs": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Slugs"
          }
        },
        "title": "PatchPlatformConfigRequest",
        "type": "object"
      },
      "PersonaIn": {
        "properties": {
          "system_prompt": {
            "maxLength": 4000,
            "title": "System Prompt",
            "type": "string"
          }
        },
        "required": [
          "system_prompt"
        ],
        "title": "PersonaIn",
        "type": "object"
      },
      "PersonaOut": {
        "properties": {
          "is_default": {
            "title": "Is Default",
            "type": "boolean"
          },
          "system_prompt": {
            "title": "System Prompt",
            "type": "string"
          }
        },
        "required": [
          "system_prompt",
          "is_default"
        ],
        "title": "PersonaOut",
        "type": "object"
      },
      "PinPolicyOut": {
        "description": "Current PIN policy for an instance.",
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "pin_applies_to": {
            "default": "all",
            "title": "Pin Applies To",
            "type": "string"
          },
          "pin_required_skills": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Pin Required Skills",
            "type": "array"
          },
          "pin_session_ttl_minutes": {
            "default": 30,
            "title": "Pin Session Ttl Minutes",
            "type": "integer"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "PinPolicyOut",
        "type": "object"
      },
      "PinPolicyRequest": {
        "description": "Configure which skills require PIN confirmation on an instance.",
        "properties": {
          "pin_applies_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pin Applies To"
          },
          "pin_required_skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pin Required Skills"
          },
          "pin_session_ttl_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pin Session Ttl Minutes"
          }
        },
        "title": "PinPolicyRequest",
        "type": "object"
      },
      "PinStatusOut": {
        "description": "PIN status response.",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "has_pin": {
            "title": "Has Pin",
            "type": "boolean"
          },
          "is_active": {
            "default": false,
            "title": "Is Active",
            "type": "boolean"
          },
          "is_locked": {
            "default": false,
            "title": "Is Locked",
            "type": "boolean"
          },
          "locked_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locked Until"
          }
        },
        "required": [
          "has_pin"
        ],
        "title": "PinStatusOut",
        "type": "object"
      },
      "PinVerifyOut": {
        "description": "PIN verification result \u2014 returned to the agent runtime.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "remaining_attempts": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Attempts"
          },
          "session_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Token"
          },
          "session_ttl_minutes": {
            "default": 30,
            "title": "Session Ttl Minutes",
            "type": "integer"
          },
          "verified": {
            "title": "Verified",
            "type": "boolean"
          }
        },
        "required": [
          "verified"
        ],
        "title": "PinVerifyOut",
        "type": "object"
      },
      "PlaceCustomerOut": {
        "properties": {
          "config_id": {
            "format": "uuid",
            "title": "Config Id",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "node_id": {
            "format": "uuid",
            "title": "Node Id",
            "type": "string"
          }
        },
        "required": [
          "config_id",
          "instance_id",
          "customer_id",
          "node_id"
        ],
        "title": "PlaceCustomerOut",
        "type": "object"
      },
      "PlaceCustomerRequest": {
        "properties": {
          "config_overlay": {
            "title": "Config Overlay",
            "type": "object"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Node Id"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "PlaceCustomerRequest",
        "type": "object"
      },
      "PlatformAnalyticsSummary": {
        "properties": {
          "daily_views": {
            "items": {
              "type": "object"
            },
            "title": "Daily Views",
            "type": "array"
          },
          "device_breakdown": {
            "title": "Device Breakdown",
            "type": "object"
          },
          "period_days": {
            "title": "Period Days",
            "type": "integer"
          },
          "top_pages": {
            "items": {
              "type": "object"
            },
            "title": "Top Pages",
            "type": "array"
          },
          "total_views": {
            "title": "Total Views",
            "type": "integer"
          },
          "unique_sessions": {
            "title": "Unique Sessions",
            "type": "integer"
          }
        },
        "required": [
          "period_days",
          "total_views",
          "unique_sessions",
          "top_pages"
        ],
        "title": "PlatformAnalyticsSummary",
        "type": "object"
      },
      "PlatformConfigResponse": {
        "description": "Platform-level config stored in agent_config JSONB.",
        "properties": {
          "advanced": {
            "default": {},
            "title": "Advanced",
            "type": "object"
          },
          "channels": {
            "default": {},
            "title": "Channels",
            "type": "object"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "integrations": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Integrations",
            "type": "array"
          },
          "recipe_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipe Id"
          },
          "skills": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "workflow_slugs": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Workflow Slugs",
            "type": "array"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "PlatformConfigResponse",
        "type": "object"
      },
      "PlatformFormOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "form_data": {
            "title": "Form Data",
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_read": {
            "title": "Is Read",
            "type": "boolean"
          },
          "page_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Slug"
          },
          "submitter_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitter Email"
          }
        },
        "required": [
          "id",
          "form_data",
          "is_read",
          "created_at"
        ],
        "title": "PlatformFormOut",
        "type": "object"
      },
      "PlatformPageCreate": {
        "properties": {
          "content_html": {
            "default": "",
            "title": "Content Html",
            "type": "string"
          },
          "slug": {
            "maxLength": 200,
            "title": "Slug",
            "type": "string"
          },
          "title": {
            "maxLength": 300,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "title"
        ],
        "title": "PlatformPageCreate",
        "type": "object"
      },
      "PlatformPageOut": {
        "properties": {
          "content_html": {
            "title": "Content Html",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "metadata_json": {
            "default": {},
            "title": "Metadata Json",
            "type": "object"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "sort_order": {
            "default": 0,
            "title": "Sort Order",
            "type": "integer"
          },
          "status": {
            "default": "draft",
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "content_html",
          "updated_at"
        ],
        "title": "PlatformPageOut",
        "type": "object"
      },
      "PlatformPageUpdate": {
        "properties": {
          "content_html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Html"
          },
          "metadata_json": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata Json"
          },
          "sort_order": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sort Order"
          },
          "status": {
            "anyOf": [
              {
                "pattern": "^(draft|published|archived)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "PlatformPageUpdate",
        "type": "object"
      },
      "PluginConnectionOut": {
        "properties": {
          "connection_type": {
            "title": "Connection Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "plugin_entity_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plugin Entity Id"
          },
          "plugin_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plugin Provider"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "provider",
          "name",
          "status",
          "connection_type",
          "created_at"
        ],
        "title": "PluginConnectionOut",
        "type": "object"
      },
      "PluginToolOut": {
        "properties": {
          "app_name": {
            "title": "App Name",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "parameters": {
            "title": "Parameters",
            "type": "object"
          },
          "provider_slug": {
            "title": "Provider Slug",
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "parameters",
          "provider_slug",
          "app_name"
        ],
        "title": "PluginToolOut",
        "type": "object"
      },
      "PollResponse": {
        "properties": {
          "found": {
            "title": "Found",
            "type": "boolean"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "required": [
          "found"
        ],
        "title": "PollResponse",
        "type": "object"
      },
      "PortalAnalyticsOut": {
        "properties": {
          "daily_views": {
            "items": {
              "type": "object"
            },
            "title": "Daily Views",
            "type": "array"
          },
          "device_breakdown": {
            "title": "Device Breakdown",
            "type": "object"
          },
          "period_days": {
            "title": "Period Days",
            "type": "integer"
          },
          "top_pages": {
            "items": {
              "type": "object"
            },
            "title": "Top Pages",
            "type": "array"
          },
          "total_views": {
            "title": "Total Views",
            "type": "integer"
          },
          "unique_sessions": {
            "title": "Unique Sessions",
            "type": "integer"
          }
        },
        "required": [
          "period_days",
          "total_views",
          "unique_sessions",
          "top_pages"
        ],
        "title": "PortalAnalyticsOut",
        "type": "object"
      },
      "PortalChatRequest": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "message": {
            "maxLength": 8000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "PortalChatRequest",
        "type": "object"
      },
      "PortalFormOut": {
        "properties": {
          "fields": {
            "title": "Fields",
            "type": "object"
          },
          "form_name": {
            "default": "",
            "title": "Form Name",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "submitted_at": {
            "format": "date-time",
            "title": "Submitted At",
            "type": "string"
          },
          "submitter_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitter Email"
          },
          "submitter_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitter Name"
          }
        },
        "required": [
          "id",
          "submitted_at",
          "status",
          "fields"
        ],
        "title": "PortalFormOut",
        "type": "object"
      },
      "PortalPageOut": {
        "properties": {
          "content_html": {
            "default": "",
            "title": "Content Html",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "published": {
            "default": false,
            "title": "Published",
            "type": "boolean"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "sort_order": {
            "title": "Sort Order",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "status",
          "sort_order",
          "updated_at"
        ],
        "title": "PortalPageOut",
        "type": "object"
      },
      "PortalSiteOut": {
        "properties": {
          "content_mode": {
            "title": "Content Mode",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "hosting_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosting Mode"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "primary_domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Domain"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "content_mode",
          "status",
          "created_at"
        ],
        "title": "PortalSiteOut",
        "type": "object"
      },
      "PresetCatalogItem": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "PresetCatalogItem",
        "type": "object"
      },
      "PresetCatalogResponse": {
        "properties": {
          "presets": {
            "items": {
              "$ref": "#/components/schemas/PresetCatalogItem"
            },
            "title": "Presets",
            "type": "array"
          }
        },
        "required": [
          "presets"
        ],
        "title": "PresetCatalogResponse",
        "type": "object"
      },
      "PreviewOut": {
        "description": "Preview payload: config + brand + template merged for client-side rendering.",
        "properties": {
          "brand": {
            "default": {},
            "title": "Brand",
            "type": "object"
          },
          "content": {
            "default": {},
            "title": "Content",
            "type": "object"
          },
          "content_mode": {
            "default": "bundle",
            "title": "Content Mode",
            "type": "string"
          },
          "custom_upload": {
            "default": false,
            "title": "Custom Upload",
            "type": "boolean"
          },
          "pricing": {
            "default": {},
            "title": "Pricing",
            "type": "object"
          },
          "seo": {
            "default": {},
            "title": "Seo",
            "type": "object"
          },
          "template_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Name"
          },
          "template_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Slug"
          }
        },
        "title": "PreviewOut",
        "type": "object"
      },
      "ProfileOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "title": "Customer Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "email_verified": {
            "title": "Email Verified",
            "type": "boolean"
          },
          "is_admin": {
            "title": "Is Admin",
            "type": "boolean"
          },
          "last_login": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login"
          },
          "oauth_providers": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Oauth Providers",
            "type": "array"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "email",
          "customer_id",
          "tenant_id",
          "is_admin",
          "email_verified",
          "created_at"
        ],
        "title": "ProfileOut",
        "type": "object"
      },
      "ProviderAvailability": {
        "properties": {
          "byok_configured": {
            "title": "Byok Configured",
            "type": "boolean"
          },
          "platform_available": {
            "title": "Platform Available",
            "type": "boolean"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "runtime_will_work": {
            "title": "Runtime Will Work",
            "type": "boolean"
          }
        },
        "required": [
          "provider",
          "byok_configured",
          "platform_available",
          "runtime_will_work"
        ],
        "title": "ProviderAvailability",
        "type": "object"
      },
      "ProvisionPollResponse": {
        "description": "Lightweight response for polling deploy status by idempotency key.\n\nNote: ip_address deliberately omitted \u2014 no need to expose VPS IP\nduring the deploy flow. Operators can see it on the instance detail page.\n\"Loose lips sink ships.\" \u2014 WWII poster (and provision poll responses)",
        "properties": {
          "bootstrap_seq": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bootstrap Seq"
          },
          "bootstrap_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bootstrap Stage"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "found": {
            "title": "Found",
            "type": "boolean"
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "logs": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logs"
          },
          "provisioning_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provisioning Stage"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "required": [
          "found"
        ],
        "title": "ProvisionPollResponse",
        "type": "object"
      },
      "ProvisionStatusResponse": {
        "description": "Quick status check for a provisioned instance.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "status",
          "created_at"
        ],
        "title": "ProvisionStatusResponse",
        "type": "object"
      },
      "PublishResult": {
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "status",
          "message"
        ],
        "title": "PublishResult",
        "type": "object"
      },
      "PublisherCreate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "maxLength": 80,
            "minLength": 3,
            "title": "Slug",
            "type": "string"
          },
          "website_url": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Website Url"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "title": "PublisherCreate",
        "type": "object"
      },
      "PublisherOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          },
          "website_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Website Url"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "status",
          "created_at"
        ],
        "title": "PublisherOut",
        "type": "object"
      },
      "PublisherUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "logo_url": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "website_url": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Website Url"
          }
        },
        "title": "PublisherUpdate",
        "type": "object"
      },
      "QueryRequest": {
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "query": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Query",
            "type": "string"
          },
          "top_k": {
            "default": 5,
            "maximum": 20.0,
            "minimum": 1.0,
            "title": "Top K",
            "type": "integer"
          }
        },
        "required": [
          "query"
        ],
        "title": "QueryRequest",
        "type": "object"
      },
      "QueryResponse": {
        "properties": {
          "query": {
            "title": "Query",
            "type": "string"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ChunkResult"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "results",
          "query",
          "total"
        ],
        "title": "QueryResponse",
        "type": "object"
      },
      "QuoteCreate": {
        "properties": {
          "client_email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Email"
          },
          "client_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "job_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Id"
          },
          "line_items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LineItemInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Line Items"
          },
          "margin_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Pct"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "quote_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Number"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "QuoteCreate",
        "type": "object"
      },
      "QuoteUpdate": {
        "properties": {
          "client_email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Email"
          },
          "client_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "margin_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Pct"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of: ('draft', 'sent', 'accepted', 'declined', 'expired')",
            "title": "Status"
          }
        },
        "title": "QuoteUpdate",
        "type": "object"
      },
      "RebindRequest": {
        "properties": {
          "new_address": {
            "maxLength": 255,
            "minLength": 1,
            "title": "New Address",
            "type": "string"
          }
        },
        "required": [
          "new_address"
        ],
        "title": "RebindRequest",
        "type": "object"
      },
      "RecipeCreate": {
        "properties": {
          "approval_rules": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Rules"
          },
          "channel_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Config"
          },
          "channel_types": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": [],
            "title": "Channel Types"
          },
          "compliance_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Config"
          },
          "connection_requirements": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": [],
            "title": "Connection Requirements"
          },
          "data_access": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Access"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hosting_mode": {
            "default": "dedicated",
            "pattern": "^(dedicated|shared)$",
            "title": "Hosting Mode",
            "type": "string"
          },
          "manifest_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom manifest ID (e.g., leslie-agent)",
            "title": "Manifest Id"
          },
          "mcp_servers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": [],
            "title": "Mcp Servers"
          },
          "model_policy": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Policy"
          },
          "module_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Module Config"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "onboarding_flow_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Onboarding Flow Id"
          },
          "rules_template_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rules Template Id"
          },
          "shared_node_capacity": {
            "anyOf": [
              {
                "maximum": 200.0,
                "minimum": 10.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 50,
            "title": "Shared Node Capacity"
          },
          "sidecars": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sidecar declarations [{name, port, path, health, runtime}]",
            "title": "Sidecars"
          },
          "skills": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          },
          "trigger_templates": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trigger Templates"
          },
          "voice_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Config"
          },
          "workflow_slugs": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Workflow Slugs",
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "title": "RecipeCreate",
        "type": "object"
      },
      "RecipeOut": {
        "properties": {
          "approval_rules": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Rules"
          },
          "channel_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Config"
          },
          "channel_types": {
            "default": [],
            "items": {},
            "title": "Channel Types",
            "type": "array"
          },
          "compliance_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Config"
          },
          "connection_requirements": {
            "default": [],
            "items": {},
            "title": "Connection Requirements",
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data_access": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Access"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hosting_mode": {
            "default": "dedicated",
            "title": "Hosting Mode",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_platform_template": {
            "default": false,
            "title": "Is Platform Template",
            "type": "boolean"
          },
          "manifest_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manifest Id"
          },
          "mcp_servers": {
            "default": [],
            "items": {},
            "title": "Mcp Servers",
            "type": "array"
          },
          "model_policy": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Policy"
          },
          "module_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Module Config"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "onboarding_flow_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Onboarding Flow Id"
          },
          "rules_template_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rules Template Id"
          },
          "shared_node_capacity": {
            "default": 50,
            "title": "Shared Node Capacity",
            "type": "integer"
          },
          "sidecars": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sidecars"
          },
          "skills": {
            "items": {},
            "title": "Skills",
            "type": "array"
          },
          "source_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Instance Id"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "trigger_templates": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": [],
            "title": "Trigger Templates"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "voice_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Config"
          },
          "workflow_slugs": {
            "items": {},
            "title": "Workflow Slugs",
            "type": "array"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "description",
          "system_prompt",
          "skills",
          "channel_config",
          "approval_rules",
          "module_config",
          "workflow_slugs",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "RecipeOut",
        "type": "object"
      },
      "RecipeUpdate": {
        "properties": {
          "approval_rules": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Rules"
          },
          "channel_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Config"
          },
          "channel_types": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Types"
          },
          "compliance_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Config"
          },
          "connection_requirements": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Requirements"
          },
          "data_access": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Access"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hosting_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosting Mode"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "manifest_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manifest Id"
          },
          "mcp_servers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Servers"
          },
          "model_policy": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Policy"
          },
          "module_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Module Config"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "onboarding_flow_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Onboarding Flow Id"
          },
          "rules_template_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rules Template Id"
          },
          "shared_node_capacity": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shared Node Capacity"
          },
          "sidecars": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sidecars"
          },
          "skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          },
          "trigger_templates": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trigger Templates"
          },
          "voice_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Config"
          },
          "workflow_slugs": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Slugs"
          }
        },
        "title": "RecipeUpdate",
        "type": "object"
      },
      "RecordCreate": {
        "properties": {
          "created_by": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "data": {
            "title": "Data",
            "type": "object"
          },
          "definition_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Definition Id"
          },
          "definition_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Definition Slug"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "RecordCreate",
        "type": "object"
      },
      "RecordUpdate": {
        "properties": {
          "data": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "status": {
            "anyOf": [
              {
                "pattern": "^(active|archived)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "title": "RecordUpdate",
        "type": "object"
      },
      "RecordUsageRequest": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "cost_platform_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Platform Usd"
          },
          "cost_tenant_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Tenant Usd"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "is_byok": {
            "default": false,
            "title": "Is Byok",
            "type": "boolean"
          },
          "key_source": {
            "default": "platform",
            "maxLength": 20,
            "title": "Key Source",
            "type": "string"
          },
          "modality": {
            "maxLength": 30,
            "title": "Modality",
            "type": "string"
          },
          "model_slug": {
            "maxLength": 100,
            "title": "Model Slug",
            "type": "string"
          },
          "provider": {
            "maxLength": 50,
            "title": "Provider",
            "type": "string"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "task": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task"
          },
          "tokens_cached": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Cached"
          },
          "tokens_input": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Input"
          },
          "tokens_output": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Output"
          },
          "total_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Ms"
          },
          "ttft_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ttft Ms"
          },
          "units": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Units"
          }
        },
        "required": [
          "modality",
          "model_slug",
          "provider"
        ],
        "title": "RecordUsageRequest",
        "type": "object"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "default": "",
            "title": "Refresh Token",
            "type": "string"
          }
        },
        "title": "RefreshRequest",
        "type": "object"
      },
      "RegionOut": {
        "properties": {
          "country_code": {
            "title": "Country Code",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "country_code"
        ],
        "title": "RegionOut",
        "type": "object"
      },
      "RegisterResponse": {
        "properties": {
          "compatibility_hash": {
            "title": "Compatibility Hash",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "manifest_id": {
            "title": "Manifest Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "snapshot_id": {
            "title": "Snapshot Id",
            "type": "string"
          },
          "superseded": {
            "title": "Superseded",
            "type": "boolean"
          },
          "superseded_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded Id"
          }
        },
        "required": [
          "id",
          "manifest_id",
          "provider",
          "snapshot_id",
          "compatibility_hash",
          "superseded_id",
          "superseded"
        ],
        "title": "RegisterResponse",
        "type": "object"
      },
      "RelationshipCreate": {
        "properties": {
          "from_record_id": {
            "format": "uuid",
            "title": "From Record Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "relationship_type": {
            "maxLength": 50,
            "minLength": 1,
            "title": "Relationship Type",
            "type": "string"
          },
          "to_record_id": {
            "format": "uuid",
            "title": "To Record Id",
            "type": "string"
          }
        },
        "required": [
          "from_record_id",
          "to_record_id",
          "relationship_type"
        ],
        "title": "RelationshipCreate",
        "type": "object"
      },
      "ResellerPricingOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "markup_cents": {
            "title": "Markup Cents",
            "type": "integer"
          },
          "markup_percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Markup Percent"
          },
          "skill_id": {
            "format": "uuid",
            "title": "Skill Id",
            "type": "string"
          },
          "skill_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Name"
          }
        },
        "required": [
          "id",
          "skill_id",
          "markup_cents",
          "enabled",
          "created_at"
        ],
        "title": "ResellerPricingOut",
        "type": "object"
      },
      "ResellerPricingSet": {
        "properties": {
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "markup_cents": {
            "default": 0,
            "minimum": 0.0,
            "title": "Markup Cents",
            "type": "integer"
          },
          "markup_percent": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Markup Percent"
          },
          "skill_id": {
            "format": "uuid",
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "skill_id"
        ],
        "title": "ResellerPricingSet",
        "type": "object"
      },
      "ResendCodeRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "ResendCodeRequest",
        "type": "object"
      },
      "ResetPasswordRequest": {
        "properties": {
          "new_password": {
            "maxLength": 128,
            "minLength": 8,
            "title": "New Password",
            "type": "string"
          },
          "token": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token",
          "new_password"
        ],
        "title": "ResetPasswordRequest",
        "type": "object"
      },
      "ResolvedModelPolicy": {
        "properties": {
          "budget_daily_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Daily Usd"
          },
          "budget_monthly_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Monthly Usd"
          },
          "embedding_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Model"
          },
          "fallback_models": {
            "items": {
              "type": "string"
            },
            "title": "Fallback Models",
            "type": "array"
          },
          "max_tokens": {
            "title": "Max Tokens",
            "type": "integer"
          },
          "primary_model": {
            "title": "Primary Model",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "temperature": {
            "title": "Temperature",
            "type": "number"
          }
        },
        "required": [
          "primary_model",
          "fallback_models",
          "temperature",
          "max_tokens",
          "budget_daily_usd",
          "budget_monthly_usd",
          "embedding_model",
          "source"
        ],
        "title": "ResolvedModelPolicy",
        "type": "object"
      },
      "ResolvedModelWithKey": {
        "description": "Resolved model + decrypted API key for the runtime.",
        "properties": {
          "api_base_url": {
            "title": "Api Base Url",
            "type": "string"
          },
          "api_format": {
            "title": "Api Format",
            "type": "string"
          },
          "api_key": {
            "title": "Api Key",
            "type": "string"
          },
          "capabilities": {
            "items": {},
            "title": "Capabilities",
            "type": "array"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "cost_cached_input_per_mtok": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Cached Input Per Mtok"
          },
          "cost_input_per_mtok": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Input Per Mtok"
          },
          "cost_output_per_mtok": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Output Per Mtok"
          },
          "key_source": {
            "title": "Key Source",
            "type": "string"
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens"
          },
          "model_id": {
            "title": "Model Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "provider",
          "model_id",
          "api_format",
          "api_base_url",
          "capabilities",
          "api_key",
          "key_source"
        ],
        "title": "ResolvedModelWithKey",
        "type": "object"
      },
      "ResultOut": {
        "properties": {
          "agent_response": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Response"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evaluation_id": {
            "format": "uuid",
            "title": "Evaluation Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "score_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reason"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "test_case_id": {
            "format": "uuid",
            "title": "Test Case Id",
            "type": "string"
          },
          "tokens_used": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Used"
          },
          "tool_calls_made": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Calls Made"
          }
        },
        "required": [
          "id",
          "evaluation_id",
          "test_case_id",
          "agent_response",
          "tool_calls_made",
          "score",
          "score_reason",
          "latency_ms",
          "tokens_used",
          "status",
          "created_at"
        ],
        "title": "ResultOut",
        "type": "object"
      },
      "ResumeWorkflowRequest": {
        "properties": {
          "resume_data": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Data merged into workflow_state on resume",
            "title": "Resume Data"
          }
        },
        "title": "ResumeWorkflowRequest",
        "type": "object"
      },
      "RevokeRequest": {
        "properties": {
          "reason": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "title": "RevokeRequest",
        "type": "object"
      },
      "RoleUpdateRequest": {
        "properties": {
          "team_role": {
            "description": "New team role",
            "title": "Team Role",
            "type": "string"
          }
        },
        "required": [
          "team_role"
        ],
        "title": "RoleUpdateRequest",
        "type": "object"
      },
      "RollbackResponse": {
        "properties": {
          "manifest_id": {
            "title": "Manifest Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "restored": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Restored"
          },
          "rolled_back_from": {
            "title": "Rolled Back From",
            "type": "string"
          }
        },
        "required": [
          "rolled_back_from",
          "restored",
          "manifest_id",
          "provider"
        ],
        "title": "RollbackResponse",
        "type": "object"
      },
      "RosterResponseRequest": {
        "properties": {
          "channel": {
            "default": "whatsapp",
            "maxLength": 30,
            "title": "Channel",
            "type": "string"
          },
          "person_id": {
            "format": "uuid",
            "title": "Person Id",
            "type": "string"
          },
          "response_text": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Response Text",
            "type": "string"
          }
        },
        "required": [
          "person_id",
          "response_text"
        ],
        "title": "RosterResponseRequest",
        "type": "object"
      },
      "RotateKeyResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "instance_id"
        ],
        "title": "RotateKeyResponse",
        "type": "object"
      },
      "RouteEntry": {
        "description": "Single domain \u2192 VPS route for the edge proxy.\n\nInstance-scoped: each domain is pinned to exactly one VPS via\nedge_instance_id on TenantBranding. No tenant_id exposed \u2014 the\nedge proxy is a sacrificial host and doesn't need cross-tenant metadata.\n\"Need to know basis. And you don't need to know.\" \u2014 Colonel Trautman, Rambo",
        "properties": {
          "domain": {
            "title": "Domain",
            "type": "string"
          },
          "gateway_port": {
            "default": 18789,
            "title": "Gateway Port",
            "type": "integer"
          },
          "vpn_ip": {
            "title": "Vpn Ip",
            "type": "string"
          }
        },
        "required": [
          "domain",
          "vpn_ip"
        ],
        "title": "RouteEntry",
        "type": "object"
      },
      "RouteResult": {
        "properties": {
          "response": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response"
          },
          "routed_to": {
            "title": "Routed To",
            "type": "string"
          },
          "target_instance_id": {
            "title": "Target Instance Id",
            "type": "string"
          },
          "workflow_record_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Record Id"
          }
        },
        "required": [
          "routed_to",
          "target_instance_id"
        ],
        "title": "RouteResult",
        "type": "object"
      },
      "RouteToAgentRequest": {
        "properties": {
          "context": {
            "description": "Handoff context (caller info, request summary, etc.)",
            "title": "Context",
            "type": "object"
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "create_workflow_record": {
            "default": true,
            "title": "Create Workflow Record",
            "type": "boolean"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "message": {
            "maxLength": 8000,
            "title": "Message",
            "type": "string"
          },
          "target_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Instance Id"
          },
          "target_role": {
            "anyOf": [
              {
                "pattern": "^[a-z][a-z0-9_-]{0,49}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Agent role \u2014 must match agent_config.agent.role",
            "title": "Target Role"
          }
        },
        "required": [
          "customer_id",
          "message"
        ],
        "title": "RouteToAgentRequest",
        "type": "object"
      },
      "RoutesResponse": {
        "description": "Full route table returned to the edge proxy.\n\nversion is monotonically increasing (epoch millis) so the edge\nagent can detect stale responses.  hmac_sha256 covers the JSON\nserialisation of routes + version for integrity.\n\n\"Trust, but verify. Then verify again.\" \u2014 Paranoid sysadmin proverb",
        "properties": {
          "hmac_sha256": {
            "title": "Hmac Sha256",
            "type": "string"
          },
          "routes": {
            "items": {
              "$ref": "#/components/schemas/RouteEntry"
            },
            "title": "Routes",
            "type": "array"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "routes",
          "hmac_sha256"
        ],
        "title": "RoutesResponse",
        "type": "object"
      },
      "RuleCreate": {
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/ActionSchema"
            },
            "minItems": 1,
            "title": "Actions",
            "type": "array"
          },
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/ConditionSchema"
            },
            "title": "Conditions",
            "type": "array"
          },
          "cooldown_seconds": {
            "default": 300,
            "minimum": 0.0,
            "title": "Cooldown Seconds",
            "type": "integer"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "NULL = tenant-wide, set = customer-specific",
            "title": "Customer Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "priority": {
            "default": 0,
            "minimum": 0.0,
            "title": "Priority",
            "type": "integer"
          },
          "rule_key": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Override key \u2014 same key suppresses tenant rule",
            "title": "Rule Key"
          },
          "trigger_event": {
            "title": "Trigger Event",
            "type": "string"
          }
        },
        "required": [
          "name",
          "trigger_event"
        ],
        "title": "RuleCreate",
        "type": "object"
      },
      "RuleDefinition": {
        "properties": {
          "actions": {
            "default": [],
            "items": {
              "type": "object"
            },
            "title": "Actions",
            "type": "array"
          },
          "conditions": {
            "default": [],
            "items": {
              "type": "object"
            },
            "title": "Conditions",
            "type": "array"
          },
          "cooldown_seconds": {
            "default": 300,
            "title": "Cooldown Seconds",
            "type": "integer"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "priority": {
            "default": 0,
            "title": "Priority",
            "type": "integer"
          },
          "rule_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Key"
          },
          "trigger_event": {
            "title": "Trigger Event",
            "type": "string"
          }
        },
        "required": [
          "name",
          "trigger_event"
        ],
        "title": "RuleDefinition",
        "type": "object"
      },
      "RuleOut": {
        "properties": {
          "actions": {
            "items": {
              "type": "object"
            },
            "title": "Actions",
            "type": "array"
          },
          "conditions": {
            "items": {
              "type": "object"
            },
            "title": "Conditions",
            "type": "array"
          },
          "cooldown_seconds": {
            "title": "Cooldown Seconds",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "last_triggered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Triggered At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "priority": {
            "title": "Priority",
            "type": "integer"
          },
          "rule_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Key"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "trigger_count": {
            "title": "Trigger Count",
            "type": "integer"
          },
          "trigger_event": {
            "title": "Trigger Event",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "instance_id",
          "name",
          "description",
          "trigger_event",
          "conditions",
          "actions",
          "is_active",
          "priority",
          "cooldown_seconds",
          "last_triggered_at",
          "trigger_count",
          "created_at",
          "updated_at"
        ],
        "title": "RuleOut",
        "type": "object"
      },
      "RuleTestRequest": {
        "description": "Dry-run test: provide a sample payload and see which conditions match.",
        "properties": {
          "payload": {
            "description": "Sample event payload to test against",
            "title": "Payload",
            "type": "object"
          }
        },
        "required": [
          "payload"
        ],
        "title": "RuleTestRequest",
        "type": "object"
      },
      "RuleTestResult": {
        "properties": {
          "actions_that_would_fire": {
            "items": {
              "type": "object"
            },
            "title": "Actions That Would Fire",
            "type": "array"
          },
          "all_conditions_met": {
            "title": "All Conditions Met",
            "type": "boolean"
          },
          "condition_results": {
            "items": {
              "type": "object"
            },
            "title": "Condition Results",
            "type": "array"
          },
          "rule_id": {
            "format": "uuid",
            "title": "Rule Id",
            "type": "string"
          },
          "rule_name": {
            "title": "Rule Name",
            "type": "string"
          }
        },
        "required": [
          "rule_id",
          "rule_name",
          "all_conditions_met",
          "condition_results",
          "actions_that_would_fire"
        ],
        "title": "RuleTestResult",
        "type": "object"
      },
      "RuleUpdate": {
        "properties": {
          "actions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ActionSchema"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actions"
          },
          "conditions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ConditionSchema"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conditions"
          },
          "cooldown_seconds": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cooldown Seconds"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "priority": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "rule_key": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Key"
          },
          "trigger_event": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trigger Event"
          }
        },
        "title": "RuleUpdate",
        "type": "object"
      },
      "RunResponse": {
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "status"
        ],
        "title": "RunResponse",
        "type": "object"
      },
      "RuntimeAuditBatchIn": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/RuntimeAuditEventIn"
            },
            "maxItems": 100,
            "minItems": 1,
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "events"
        ],
        "title": "RuntimeAuditBatchIn",
        "type": "object"
      },
      "RuntimeAuditEventIn": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "event_id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Event Id",
            "type": "string"
          },
          "event_ts": {
            "format": "date-time",
            "title": "Event Ts",
            "type": "string"
          },
          "event_type": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Event Type",
            "type": "string"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "outcome": {
            "pattern": "^(success|denied|error)$",
            "title": "Outcome",
            "type": "string"
          },
          "request_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "role": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "server_slug": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Slug"
          },
          "source": {
            "maxLength": 32,
            "minLength": 1,
            "title": "Source",
            "type": "string"
          },
          "tool_name": {
            "anyOf": [
              {
                "maxLength": 150,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Name"
          }
        },
        "required": [
          "event_id",
          "source",
          "event_type",
          "outcome",
          "event_ts"
        ],
        "title": "RuntimeAuditEventIn",
        "type": "object"
      },
      "RuntimeAuditEventOut": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "event_id": {
            "title": "Event Id",
            "type": "string"
          },
          "event_ts": {
            "title": "Event Ts",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "ingested_at": {
            "title": "Ingested At",
            "type": "string"
          },
          "metadata_json": {
            "title": "Metadata Json",
            "type": "object"
          },
          "outcome": {
            "title": "Outcome",
            "type": "string"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "server_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Slug"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "tool_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Name"
          }
        },
        "required": [
          "id",
          "event_id",
          "source",
          "event_type",
          "outcome",
          "event_ts",
          "ingested_at"
        ],
        "title": "RuntimeAuditEventOut",
        "type": "object"
      },
      "RuntimeAuditResponse": {
        "properties": {
          "accepted": {
            "title": "Accepted",
            "type": "integer"
          },
          "duplicates": {
            "title": "Duplicates",
            "type": "integer"
          },
          "errors": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          },
          "rejected": {
            "title": "Rejected",
            "type": "integer"
          }
        },
        "required": [
          "accepted",
          "duplicates",
          "rejected"
        ],
        "title": "RuntimeAuditResponse",
        "type": "object"
      },
      "RuntimeAuditSummaryOut": {
        "properties": {
          "by_source": {
            "title": "By Source",
            "type": "object"
          },
          "denied_events": {
            "title": "Denied Events",
            "type": "integer"
          },
          "error_events": {
            "title": "Error Events",
            "type": "integer"
          },
          "success_events": {
            "title": "Success Events",
            "type": "integer"
          },
          "total_events": {
            "title": "Total Events",
            "type": "integer"
          }
        },
        "required": [
          "total_events",
          "success_events",
          "denied_events",
          "error_events"
        ],
        "title": "RuntimeAuditSummaryOut",
        "type": "object"
      },
      "RuntimeImageOut": {
        "properties": {
          "built_at": {
            "format": "date-time",
            "title": "Built At",
            "type": "string"
          },
          "bundle_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Hash"
          },
          "compatibility_hash": {
            "title": "Compatibility Hash",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "manifest_id": {
            "title": "Manifest Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "registered_at": {
            "format": "date-time",
            "title": "Registered At",
            "type": "string"
          },
          "registered_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registered By"
          },
          "runtime_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime Version"
          },
          "snapshot_id": {
            "title": "Snapshot Id",
            "type": "string"
          },
          "superseded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded At"
          }
        },
        "required": [
          "id",
          "manifest_id",
          "provider",
          "snapshot_id",
          "compatibility_hash",
          "bundle_hash",
          "runtime_version",
          "built_at",
          "registered_by",
          "registered_at",
          "superseded_at"
        ],
        "title": "RuntimeImageOut",
        "type": "object"
      },
      "RuntimeRedeployResponse": {
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "status",
          "task_id",
          "message"
        ],
        "title": "RuntimeRedeployResponse",
        "type": "object"
      },
      "RuntimeRolloutDetailOut": {
        "properties": {
          "rollout": {
            "$ref": "#/components/schemas/RuntimeRolloutSummaryOut"
          },
          "targets": {
            "items": {
              "$ref": "#/components/schemas/RuntimeRolloutTargetOut"
            },
            "title": "Targets",
            "type": "array"
          }
        },
        "required": [
          "rollout",
          "targets"
        ],
        "title": "RuntimeRolloutDetailOut",
        "type": "object"
      },
      "RuntimeRolloutSummaryOut": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "failed_targets": {
            "title": "Failed Targets",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "in_progress_targets": {
            "title": "In Progress Targets",
            "type": "integer"
          },
          "initiated_from_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initiated From Ip"
          },
          "metadata_json": {
            "title": "Metadata Json",
            "type": "object"
          },
          "queued_targets": {
            "title": "Queued Targets",
            "type": "integer"
          },
          "scope": {
            "title": "Scope",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "succeeded_targets": {
            "title": "Succeeded Targets",
            "type": "integer"
          },
          "total_targets": {
            "title": "Total Targets",
            "type": "integer"
          },
          "uncertain_targets": {
            "title": "Uncertain Targets",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "scope",
          "status",
          "total_targets",
          "queued_targets",
          "in_progress_targets",
          "succeeded_targets",
          "failed_targets",
          "uncertain_targets",
          "created_at"
        ],
        "title": "RuntimeRolloutSummaryOut",
        "type": "object"
      },
      "RuntimeRolloutTargetOut": {
        "properties": {
          "bundle_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Hash"
          },
          "celery_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Celery Task Id"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "detail_json": {
            "title": "Detail Json",
            "type": "object"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "last_result_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Result Status"
          },
          "rollout_id": {
            "title": "Rollout Id",
            "type": "string"
          },
          "rollout_scope": {
            "title": "Rollout Scope",
            "type": "string"
          },
          "rollout_status": {
            "title": "Rollout Status",
            "type": "string"
          },
          "scheduled_countdown_seconds": {
            "title": "Scheduled Countdown Seconds",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "rollout_id",
          "instance_id",
          "scheduled_countdown_seconds",
          "status",
          "created_at",
          "rollout_scope",
          "rollout_status"
        ],
        "title": "RuntimeRolloutTargetOut",
        "type": "object"
      },
      "RuntimeRolloutTimelineEntry": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "instance_hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Hostname"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "last_result_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Result Status"
          },
          "scheduled_countdown_seconds": {
            "title": "Scheduled Countdown Seconds",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "target_id": {
            "title": "Target Id",
            "type": "string"
          }
        },
        "required": [
          "target_id",
          "instance_id",
          "status",
          "scheduled_countdown_seconds",
          "created_at"
        ],
        "title": "RuntimeRolloutTimelineEntry",
        "type": "object"
      },
      "RuntimeRolloutTimelineOut": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "rollout_id": {
            "title": "Rollout Id",
            "type": "string"
          },
          "scope": {
            "title": "Scope",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "timeline": {
            "items": {
              "$ref": "#/components/schemas/RuntimeRolloutTimelineEntry"
            },
            "title": "Timeline",
            "type": "array"
          },
          "total_duration_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Duration Seconds"
          },
          "total_targets": {
            "title": "Total Targets",
            "type": "integer"
          }
        },
        "required": [
          "rollout_id",
          "scope",
          "status",
          "total_targets",
          "timeline",
          "created_at"
        ],
        "title": "RuntimeRolloutTimelineOut",
        "type": "object"
      },
      "RuntimeStatusResponse": {
        "description": "Runtime health and version info from the VPS agent.\n\nReturns useful context in ALL states \u2014 not just when running.\nDuring provisioning: bootstrap_stage, provision_logs, health_status.\nWhen running: live agent data + health context.\nWhen unreachable: last known health data so the UI can explain WHY.\n\n\"I see dead processes.\" \u2014 Cole Sear, The Sixth Sense (networking edition)",
        "properties": {
          "active_connections": {
            "default": 0,
            "title": "Active Connections",
            "type": "integer"
          },
          "bootstrap_seq": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bootstrap Seq"
          },
          "bootstrap_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bootstrap Stage"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "health_failures": {
            "default": 0,
            "title": "Health Failures",
            "type": "integer"
          },
          "health_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Health Status"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "last_heartbeat": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Heartbeat"
          },
          "node_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Node Version"
          },
          "openclaw_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Openclaw Version"
          },
          "provision_logs": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provision Logs"
          },
          "provisioning_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provisioning Stage"
          },
          "skills_loaded": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Skills Loaded",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "uptime_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uptime Seconds"
          }
        },
        "required": [
          "instance_id",
          "status"
        ],
        "title": "RuntimeStatusResponse",
        "type": "object"
      },
      "SMSSetup": {
        "properties": {
          "account_sid": {
            "description": "Twilio Account SID",
            "title": "Account Sid",
            "type": "string"
          },
          "auth_token": {
            "description": "Twilio Auth Token (stored encrypted)",
            "title": "Auth Token",
            "type": "string"
          },
          "phone_number": {
            "description": "Twilio phone number (E.164 format, e.g. +61400111222)",
            "maxLength": 30,
            "title": "Phone Number",
            "type": "string"
          }
        },
        "required": [
          "phone_number",
          "account_sid",
          "auth_token"
        ],
        "title": "SMSSetup",
        "type": "object"
      },
      "SMSStatusOut": {
        "properties": {
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "webhook_url": {
            "title": "Webhook Url",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "webhook_url",
          "status"
        ],
        "title": "SMSStatusOut",
        "type": "object"
      },
      "SaveAsTemplateRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "SaveAsTemplateRequest",
        "type": "object"
      },
      "SaveDraftRequest": {
        "properties": {
          "answers": {
            "title": "Answers",
            "type": "object"
          },
          "current_field_index": {
            "default": 0,
            "title": "Current Field Index",
            "type": "integer"
          }
        },
        "required": [
          "answers"
        ],
        "title": "SaveDraftRequest",
        "type": "object"
      },
      "ScheduleCreate": {
        "properties": {
          "action_after_completion": {
            "default": "NONE",
            "title": "Action After Completion",
            "type": "string"
          },
          "action_config": {
            "title": "Action Config",
            "type": "object"
          },
          "action_type": {
            "title": "Action Type",
            "type": "string"
          },
          "catchup_window_minutes": {
            "default": 10,
            "maximum": 1440.0,
            "minimum": 0.0,
            "title": "Catchup Window Minutes",
            "type": "integer"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "deduplication_key": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deduplication Key"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "end_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End At"
          },
          "external_id": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "flexible_window_minutes": {
            "default": 0,
            "maximum": 60.0,
            "minimum": 0.0,
            "title": "Flexible Window Minutes",
            "type": "integer"
          },
          "max_retries": {
            "default": 3,
            "maximum": 10.0,
            "minimum": 0.0,
            "title": "Max Retries",
            "type": "integer"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "overlap_policy": {
            "default": "SKIP",
            "title": "Overlap Policy",
            "type": "string"
          },
          "pause_on_failure_count": {
            "default": 5,
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Pause On Failure Count",
            "type": "integer"
          },
          "rate_limit_per_minute": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Per Minute"
          },
          "relative_entity_definition_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Entity definition to query",
            "title": "Relative Entity Definition Id"
          },
          "relative_field_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Date field to compute offset from",
            "title": "Relative Field Name"
          },
          "relative_filter": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional filter conditions on entity records",
            "title": "Relative Filter"
          },
          "relative_offset_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Days before (-) or after (+) the field date",
            "title": "Relative Offset Days"
          },
          "retry_backoff_seconds": {
            "default": 60,
            "minimum": 0.0,
            "title": "Retry Backoff Seconds",
            "type": "integer"
          },
          "schedule_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Expression"
          },
          "schedule_type": {
            "title": "Schedule Type",
            "type": "string"
          },
          "start_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "timezone": {
            "default": "UTC",
            "maxLength": 50,
            "title": "Timezone",
            "type": "string"
          }
        },
        "required": [
          "name",
          "schedule_type",
          "action_type",
          "action_config"
        ],
        "title": "ScheduleCreate",
        "type": "object"
      },
      "ScheduleOut": {
        "properties": {
          "action_config": {
            "title": "Action Config",
            "type": "object"
          },
          "action_type": {
            "title": "Action Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_run_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run At"
          },
          "last_run_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run Status"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "next_run_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Run At"
          },
          "overlap_policy": {
            "title": "Overlap Policy",
            "type": "string"
          },
          "relative_entity_definition_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Relative Entity Definition Id"
          },
          "relative_field_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Relative Field Name"
          },
          "relative_filter": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Relative Filter"
          },
          "relative_offset_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Relative Offset Days"
          },
          "run_count": {
            "title": "Run Count",
            "type": "integer"
          },
          "schedule_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Expression"
          },
          "schedule_type": {
            "title": "Schedule Type",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "customer_id",
          "name",
          "description",
          "external_id",
          "schedule_type",
          "schedule_expression",
          "timezone",
          "action_type",
          "action_config",
          "overlap_policy",
          "status",
          "next_run_at",
          "last_run_at",
          "last_run_status",
          "run_count",
          "created_at",
          "updated_at"
        ],
        "title": "ScheduleOut",
        "type": "object"
      },
      "ScheduleUpdate": {
        "properties": {
          "action_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action Config"
          },
          "catchup_window_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Catchup Window Minutes"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "flexible_window_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flexible Window Minutes"
          },
          "max_retries": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Retries"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "overlap_policy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overlap Policy"
          },
          "rate_limit_per_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Per Minute"
          },
          "schedule_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Expression"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "title": "ScheduleUpdate",
        "type": "object"
      },
      "ScoreOverride": {
        "properties": {
          "score": {
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Score",
            "type": "integer"
          },
          "score_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reason"
          }
        },
        "required": [
          "score"
        ],
        "title": "ScoreOverride",
        "type": "object"
      },
      "ScoreSummary": {
        "properties": {
          "avg_score": {
            "title": "Avg Score",
            "type": "number"
          },
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "scorer_type": {
            "title": "Scorer Type",
            "type": "string"
          }
        },
        "required": [
          "scorer_type",
          "avg_score",
          "count"
        ],
        "title": "ScoreSummary",
        "type": "object"
      },
      "ScoreTurnRequest": {
        "properties": {
          "agent_response": {
            "title": "Agent Response",
            "type": "string"
          },
          "context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          },
          "conversation_id": {
            "title": "Conversation Id",
            "type": "string"
          },
          "input_message": {
            "title": "Input Message",
            "type": "string"
          },
          "sample_rate": {
            "default": 0.1,
            "title": "Sample Rate",
            "type": "number"
          },
          "scorers": {
            "items": {
              "type": "string"
            },
            "title": "Scorers",
            "type": "array"
          }
        },
        "required": [
          "conversation_id",
          "input_message",
          "agent_response"
        ],
        "title": "ScoreTurnRequest",
        "type": "object"
      },
      "ScoreTurnResponse": {
        "properties": {
          "scheduled": {
            "title": "Scheduled",
            "type": "boolean"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "scheduled"
        ],
        "title": "ScoreTurnResponse",
        "type": "object"
      },
      "ScoresOverviewResponse": {
        "properties": {
          "summaries": {
            "items": {
              "$ref": "#/components/schemas/ScoreSummary"
            },
            "title": "Summaries",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "summaries",
          "total"
        ],
        "title": "ScoresOverviewResponse",
        "type": "object"
      },
      "SecretsRefreshRequest": {
        "properties": {
          "vpn_ip": {
            "pattern": "^10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$",
            "title": "Vpn Ip",
            "type": "string"
          },
          "wg_public_key": {
            "title": "Wg Public Key",
            "type": "string"
          }
        },
        "required": [
          "vpn_ip",
          "wg_public_key"
        ],
        "title": "SecretsRefreshRequest",
        "type": "object"
      },
      "SecretsRefreshResponse": {
        "properties": {
          "agent_secrets": {
            "title": "Agent Secrets",
            "type": "object"
          }
        },
        "required": [
          "agent_secrets"
        ],
        "title": "SecretsRefreshResponse",
        "type": "object"
      },
      "SecretsRequest": {
        "properties": {
          "session_id": {
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "SecretsRequest",
        "type": "object"
      },
      "SecretsResponse": {
        "properties": {
          "agent_config": {
            "title": "Agent Config",
            "type": "object"
          },
          "agent_secrets": {
            "title": "Agent Secrets",
            "type": "object"
          },
          "artifact_cipher_hash": {
            "title": "Artifact Cipher Hash",
            "type": "string"
          },
          "artifact_download_token": {
            "title": "Artifact Download Token",
            "type": "string"
          },
          "bundle_plain_hash": {
            "title": "Bundle Plain Hash",
            "type": "string"
          },
          "callback_jwt": {
            "title": "Callback Jwt",
            "type": "string"
          },
          "decryption_key_hex": {
            "title": "Decryption Key Hex",
            "type": "string"
          },
          "skill_lockfile": {
            "title": "Skill Lockfile",
            "type": "object"
          }
        },
        "required": [
          "callback_jwt",
          "artifact_download_token",
          "decryption_key_hex",
          "artifact_cipher_hash",
          "bundle_plain_hash",
          "agent_config",
          "agent_secrets",
          "skill_lockfile"
        ],
        "title": "SecretsResponse",
        "type": "object"
      },
      "SendEmailRequest": {
        "properties": {
          "cc": {
            "items": {
              "type": "string"
            },
            "title": "Cc",
            "type": "array"
          },
          "html_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Html Body"
          },
          "in_reply_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "In Reply To"
          },
          "subject": {
            "maxLength": 998,
            "title": "Subject",
            "type": "string"
          },
          "text_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text Body"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "title": "To",
            "type": "array"
          }
        },
        "required": [
          "to",
          "subject"
        ],
        "title": "SendEmailRequest",
        "type": "object"
      },
      "SendFormRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "form_id": {
            "format": "uuid",
            "title": "Form Id",
            "type": "string"
          },
          "initiated_via": {
            "default": "agent",
            "title": "Initiated Via",
            "type": "string"
          },
          "respondent_person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Respondent Person Id"
          },
          "ttl_hours": {
            "default": 168,
            "maximum": 720.0,
            "minimum": 1.0,
            "title": "Ttl Hours",
            "type": "integer"
          }
        },
        "required": [
          "form_id",
          "customer_id"
        ],
        "title": "SendFormRequest",
        "type": "object"
      },
      "SetPinRequest": {
        "description": "Set or change a PIN. Digits only, 4-8 characters.",
        "properties": {
          "pin": {
            "title": "Pin",
            "type": "string"
          }
        },
        "required": [
          "pin"
        ],
        "title": "SetPinRequest",
        "type": "object"
      },
      "SettingsOut": {
        "description": "Full settings response - profile + API keys.\n\"Surely you can't be serious.\" \"I am serious... and don't call me Shirley.\"",
        "properties": {
          "api_keys": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyOut"
            },
            "title": "Api Keys",
            "type": "array"
          },
          "profile": {
            "$ref": "#/components/schemas/ProfileOut"
          }
        },
        "required": [
          "profile",
          "api_keys"
        ],
        "title": "SettingsOut",
        "type": "object"
      },
      "SheetToEntitiesRequest": {
        "properties": {
          "column_map": {
            "description": "Map column letters/indices to data fields. E.g. {'A': 'name', 'B': 'client', 'C': 'location'}",
            "title": "Column Map",
            "type": "object"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Name"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "definition_slug": {
            "description": "Entity definition slug (e.g. 'site')",
            "title": "Definition Slug",
            "type": "string"
          },
          "has_header": {
            "default": true,
            "title": "Has Header",
            "type": "boolean"
          },
          "range": {
            "default": "Sheet1",
            "title": "Range",
            "type": "string"
          },
          "spreadsheet_id": {
            "title": "Spreadsheet Id",
            "type": "string"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "required": [
          "customer_id",
          "spreadsheet_id",
          "definition_slug",
          "column_map"
        ],
        "title": "SheetToEntitiesRequest",
        "type": "object"
      },
      "SheetToStaffRequest": {
        "properties": {
          "column_map": {
            "description": "Map column letters/indices to staff fields. E.g. {'A': 'name', 'B': 'phone', 'C': 'email', 'D': 'skills'}",
            "title": "Column Map",
            "type": "object"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Name"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "has_header": {
            "default": true,
            "description": "First row is header (skip it)",
            "title": "Has Header",
            "type": "boolean"
          },
          "range": {
            "default": "Sheet1",
            "description": "A1 notation range",
            "title": "Range",
            "type": "string"
          },
          "spreadsheet_id": {
            "title": "Spreadsheet Id",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "spreadsheet_id",
          "column_map"
        ],
        "title": "SheetToStaffRequest",
        "type": "object"
      },
      "ShiftCreate": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "date": {
            "format": "date",
            "title": "Date",
            "type": "string"
          },
          "end_time": {
            "format": "time",
            "title": "End Time",
            "type": "string"
          },
          "headcount": {
            "default": 1,
            "minimum": 1.0,
            "title": "Headcount",
            "type": "integer"
          },
          "job_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Id"
          },
          "rate_per_hour": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Per Hour"
          },
          "requirements": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirements"
          },
          "site": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "start_time": {
            "format": "time",
            "title": "Start Time",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "date",
          "start_time",
          "end_time"
        ],
        "title": "ShiftCreate",
        "type": "object"
      },
      "ShiftOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "date": {
            "format": "date",
            "title": "Date",
            "type": "string"
          },
          "end_time": {
            "format": "time",
            "title": "End Time",
            "type": "string"
          },
          "filled_count": {
            "title": "Filled Count",
            "type": "integer"
          },
          "headcount": {
            "title": "Headcount",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_filled": {
            "title": "Is Filled",
            "type": "boolean"
          },
          "job_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Id"
          },
          "rate_per_hour": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Per Hour"
          },
          "requirements": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirements"
          },
          "site": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "start_time": {
            "format": "time",
            "title": "Start Time",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "date",
          "start_time",
          "end_time",
          "status",
          "headcount",
          "filled_count",
          "is_filled",
          "created_at"
        ],
        "title": "ShiftOut",
        "type": "object"
      },
      "ShiftUpdate": {
        "properties": {
          "date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "end_time": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time"
          },
          "headcount": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Headcount"
          },
          "rate_per_hour": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Per Hour"
          },
          "requirements": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirements"
          },
          "site": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "start_time": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "ShiftUpdate",
        "type": "object"
      },
      "SignupRequest": {
        "properties": {
          "company_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Company Name",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "plan": {
            "default": "starter",
            "maxLength": 50,
            "title": "Plan",
            "type": "string"
          },
          "tenant_slug": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "tenant_slug",
          "email",
          "company_name"
        ],
        "title": "SignupRequest",
        "type": "object"
      },
      "SignupResponse": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "message": {
            "default": "Check your email to get started",
            "title": "Message",
            "type": "string"
          },
          "site_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site Url"
          }
        },
        "required": [
          "customer_id"
        ],
        "title": "SignupResponse",
        "type": "object"
      },
      "SignupTokenResponse": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "expires_in": {
            "default": 3600,
            "title": "Expires In",
            "type": "integer"
          },
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "refresh_token",
          "customer_id",
          "tenant_id"
        ],
        "title": "SignupTokenResponse",
        "type": "object"
      },
      "SignupVerifyRequest": {
        "properties": {
          "code": {
            "maxLength": 6,
            "minLength": 6,
            "title": "Code",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "tenant_slug": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "email",
          "tenant_slug",
          "code"
        ],
        "title": "SignupVerifyRequest",
        "type": "object"
      },
      "SiteInfo": {
        "properties": {
          "config_id": {
            "format": "uuid",
            "title": "Config Id",
            "type": "string"
          },
          "content_mode": {
            "title": "Content Mode",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "is_primary": {
            "title": "Is Primary",
            "type": "boolean"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "config_id",
          "is_primary",
          "content_mode",
          "status"
        ],
        "title": "SiteInfo",
        "type": "object"
      },
      "SkillInstallRequest": {
        "properties": {
          "skill_id": {
            "format": "uuid",
            "title": "Skill Id",
            "type": "string"
          },
          "version_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version Id"
          }
        },
        "required": [
          "skill_id"
        ],
        "title": "SkillInstallRequest",
        "type": "object"
      },
      "SkillSubmit": {
        "properties": {
          "billing_type": {
            "default": "free",
            "title": "Billing Type",
            "type": "string"
          },
          "bundle_hash": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pre-computed composite SHA-256 for non-builtin skills. Builtin skills are hashed automatically from disk.",
            "title": "Bundle Hash"
          },
          "category": {
            "default": "general",
            "maxLength": 50,
            "title": "Category",
            "type": "string"
          },
          "changelog": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Changelog"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "emoji": {
            "default": "\ud83d\udd27",
            "maxLength": 10,
            "title": "Emoji",
            "type": "string"
          },
          "long_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Description"
          },
          "min_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Tier"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "price_cents": {
            "default": 0,
            "minimum": 0.0,
            "title": "Price Cents",
            "type": "integer"
          },
          "slug": {
            "maxLength": 100,
            "minLength": 3,
            "title": "Slug",
            "type": "string"
          },
          "source_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Ref"
          },
          "source_type": {
            "default": "uploaded",
            "title": "Source Type",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "version": {
            "default": "1.0.0",
            "maxLength": 30,
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "title": "SkillSubmit",
        "type": "object"
      },
      "SkillUpdate": {
        "properties": {
          "billing_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Type"
          },
          "category": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "emoji": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Emoji"
          },
          "long_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Description"
          },
          "min_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Tier"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "price_cents": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Cents"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "title": "SkillUpdate",
        "type": "object"
      },
      "SkillVersionOut": {
        "properties": {
          "changelog": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Changelog"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "published_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "id",
          "version",
          "status",
          "created_at"
        ],
        "title": "SkillVersionOut",
        "type": "object"
      },
      "SourceOut": {
        "properties": {
          "chunk_count": {
            "title": "Chunk Count",
            "type": "integer"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          },
          "source_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Name"
          },
          "source_type": {
            "title": "Source Type",
            "type": "string"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "source_type",
          "source_id",
          "source_name",
          "chunk_count",
          "total_tokens"
        ],
        "title": "SourceOut",
        "type": "object"
      },
      "SslLogEntryOut": {
        "description": "Single SSL audit log entry.",
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Email"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "domain": {
            "title": "Domain",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "domain",
          "action",
          "created_at"
        ],
        "title": "SslLogEntryOut",
        "type": "object"
      },
      "SslStatusDetailOut": {
        "description": "Full SSL status with recent log entries.",
        "properties": {
          "log": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/SslLogEntryOut"
            },
            "title": "Log",
            "type": "array"
          },
          "status": {
            "$ref": "#/components/schemas/SslStatusOut"
          }
        },
        "required": [
          "status"
        ],
        "title": "SslStatusDetailOut",
        "type": "object"
      },
      "SslStatusOut": {
        "description": "Current SSL/domain automation status for the tenant.",
        "properties": {
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "domain_verified": {
            "default": false,
            "title": "Domain Verified",
            "type": "boolean"
          },
          "last_check_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Check At"
          },
          "ssl_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ssl Error"
          },
          "ssl_expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ssl Expires At"
          },
          "ssl_provisioned_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ssl Provisioned At"
          },
          "ssl_status": {
            "default": "none",
            "title": "Ssl Status",
            "type": "string"
          },
          "verification_attempts": {
            "default": 0,
            "title": "Verification Attempts",
            "type": "integer"
          }
        },
        "title": "SslStatusOut",
        "type": "object"
      },
      "StaffBulkCreate": {
        "properties": {
          "staff": {
            "items": {
              "$ref": "#/components/schemas/StaffCreate"
            },
            "maxItems": 200,
            "title": "Staff",
            "type": "array"
          }
        },
        "required": [
          "staff"
        ],
        "title": "StaffBulkCreate",
        "type": "object"
      },
      "StaffCreate": {
        "properties": {
          "availability_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Availability Notes"
          },
          "certifications": {
            "items": {
              "type": "object"
            },
            "title": "Certifications",
            "type": "array"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "inductions": {
            "items": {
              "type": "object"
            },
            "title": "Inductions",
            "type": "array"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "role": {
            "default": "employee",
            "description": "One of: ('employee', 'contractor', 'supplier', 'customer_contact')",
            "title": "Role",
            "type": "string"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "tier": {
            "default": 1,
            "maximum": 5.0,
            "minimum": 1.0,
            "title": "Tier",
            "type": "integer"
          }
        },
        "required": [
          "name"
        ],
        "title": "StaffCreate",
        "type": "object"
      },
      "StaffListOut": {
        "properties": {
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "per_page": {
            "title": "Per Page",
            "type": "integer"
          },
          "staff": {
            "items": {
              "$ref": "#/components/schemas/StaffOut"
            },
            "title": "Staff",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "staff",
          "total",
          "page",
          "per_page"
        ],
        "title": "StaffListOut",
        "type": "object"
      },
      "StaffOut": {
        "properties": {
          "availability_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Availability Notes"
          },
          "certifications": {
            "default": [],
            "items": {},
            "title": "Certifications",
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "inductions": {
            "default": [],
            "items": {},
            "title": "Inductions",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "skills": {
            "default": [],
            "items": {},
            "title": "Skills",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "customer_id",
          "name",
          "role",
          "tier",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "StaffOut",
        "type": "object"
      },
      "StaffUpdate": {
        "properties": {
          "availability_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Availability Notes"
          },
          "certifications": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certifications"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "inductions": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inductions"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "tier": {
            "anyOf": [
              {
                "maximum": 5.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          }
        },
        "title": "StaffUpdate",
        "type": "object"
      },
      "StatsOut": {
        "description": "Top-level dashboard stats cards.",
        "properties": {
          "end_users_trend_pct": {
            "title": "End Users Trend Pct",
            "type": "number"
          },
          "error_instances": {
            "title": "Error Instances",
            "type": "integer"
          },
          "platform_cost_30d": {
            "title": "Platform Cost 30D",
            "type": "string"
          },
          "revenue_trend_pct": {
            "title": "Revenue Trend Pct",
            "type": "number"
          },
          "running_instances": {
            "title": "Running Instances",
            "type": "integer"
          },
          "total_end_users": {
            "title": "Total End Users",
            "type": "integer"
          },
          "total_instances": {
            "title": "Total Instances",
            "type": "integer"
          },
          "total_requests_30d": {
            "title": "Total Requests 30D",
            "type": "integer"
          },
          "total_revenue_usd": {
            "title": "Total Revenue Usd",
            "type": "string"
          },
          "total_tokens_30d": {
            "title": "Total Tokens 30D",
            "type": "integer"
          }
        },
        "required": [
          "total_instances",
          "running_instances",
          "error_instances",
          "total_revenue_usd",
          "revenue_trend_pct",
          "total_end_users",
          "end_users_trend_pct",
          "total_requests_30d",
          "total_tokens_30d",
          "platform_cost_30d"
        ],
        "title": "StatsOut",
        "type": "object"
      },
      "StatusResponse": {
        "properties": {
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "StatusResponse",
        "type": "object"
      },
      "StoreKeyRequest": {
        "properties": {
          "api_key": {
            "maxLength": 500,
            "minLength": 8,
            "title": "Api Key",
            "type": "string"
          },
          "label": {
            "default": "default",
            "maxLength": 100,
            "title": "Label",
            "type": "string"
          },
          "provider_id": {
            "maxLength": 50,
            "minLength": 1,
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "provider_id",
          "api_key"
        ],
        "title": "StoreKeyRequest",
        "type": "object"
      },
      "StoreKeyResponse": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "key_suffix": {
            "title": "Key Suffix",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "provider_id": {
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider_id",
          "key_suffix",
          "message"
        ],
        "title": "StoreKeyResponse",
        "type": "object"
      },
      "StoredKeyOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_valid": {
            "title": "Is Valid",
            "type": "boolean"
          },
          "key_suffix": {
            "title": "Key Suffix",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "last_validated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Validated At"
          },
          "provider_id": {
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider_id",
          "label",
          "key_suffix",
          "is_valid",
          "last_validated_at",
          "created_at"
        ],
        "title": "StoredKeyOut",
        "type": "object"
      },
      "SubmissionPatchRequest": {
        "properties": {
          "status": {
            "enum": [
              "read",
              "unread"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "SubmissionPatchRequest",
        "type": "object"
      },
      "SubmitFormRequest": {
        "properties": {
          "answers": {
            "title": "Answers",
            "type": "object"
          }
        },
        "required": [
          "answers"
        ],
        "title": "SubmitFormRequest",
        "type": "object"
      },
      "SubscriptionOut": {
        "description": "Subscription summary for customer detail.\n\"You had me at hello.\" \u2014 Jerry Maguire (about subscription activation)",
        "properties": {
          "canceled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Canceled At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current_period_end": {
            "format": "date-time",
            "title": "Current Period End",
            "type": "string"
          },
          "current_period_start": {
            "format": "date-time",
            "title": "Current Period Start",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "product_tier_id": {
            "format": "uuid",
            "title": "Product Tier Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "trial_ends_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Ends At"
          }
        },
        "required": [
          "id",
          "status",
          "product_tier_id",
          "current_period_start",
          "current_period_end",
          "created_at"
        ],
        "title": "SubscriptionOut",
        "type": "object"
      },
      "SuspendResumeResponse": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "message"
        ],
        "title": "SuspendResumeResponse",
        "type": "object"
      },
      "SuspendWorkflowRequest": {
        "properties": {
          "payload": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Arbitrary state payload to preserve for resume",
            "title": "Payload"
          },
          "step": {
            "description": "Step name to suspend at",
            "maxLength": 100,
            "title": "Step",
            "type": "string"
          }
        },
        "required": [
          "step"
        ],
        "title": "SuspendWorkflowRequest",
        "type": "object"
      },
      "TeamMemberOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_admin": {
            "title": "Is Admin",
            "type": "boolean"
          },
          "last_login": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login"
          },
          "team_role": {
            "title": "Team Role",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "team_role",
          "is_admin",
          "is_active",
          "created_at"
        ],
        "title": "TeamMemberOut",
        "type": "object"
      },
      "TelegramChannelResponse": {
        "description": "Response after configuring Telegram channel.",
        "properties": {
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "telegram_enabled": {
            "title": "Telegram Enabled",
            "type": "boolean"
          },
          "webhook_registered": {
            "default": false,
            "title": "Webhook Registered",
            "type": "boolean"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          }
        },
        "required": [
          "instance_id",
          "telegram_enabled",
          "message"
        ],
        "title": "TelegramChannelResponse",
        "type": "object"
      },
      "TelegramChannelSetup": {
        "description": "Request to configure Telegram channel for an instance.",
        "properties": {
          "bot_token": {
            "maxLength": 100,
            "minLength": 30,
            "title": "Bot Token",
            "type": "string"
          }
        },
        "required": [
          "bot_token"
        ],
        "title": "TelegramChannelSetup",
        "type": "object"
      },
      "TelegramChannelStatus": {
        "description": "Current Telegram channel status.",
        "properties": {
          "bot_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bot Username"
          },
          "has_bot_token": {
            "title": "Has Bot Token",
            "type": "boolean"
          },
          "telegram_enabled": {
            "title": "Telegram Enabled",
            "type": "boolean"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          }
        },
        "required": [
          "telegram_enabled",
          "has_bot_token"
        ],
        "title": "TelegramChannelStatus",
        "type": "object"
      },
      "TelemetryBatchIn": {
        "description": "Batch of usage events from a VPS agent.",
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/UsageEventIn"
            },
            "maxItems": 100,
            "minItems": 1,
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "events"
        ],
        "title": "TelemetryBatchIn",
        "type": "object"
      },
      "TelemetryResponse": {
        "description": "Response with per-event results for idempotent retry.",
        "properties": {
          "accepted": {
            "title": "Accepted",
            "type": "integer"
          },
          "duplicates": {
            "title": "Duplicates",
            "type": "integer"
          },
          "errors": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          },
          "rejected": {
            "title": "Rejected",
            "type": "integer"
          }
        },
        "required": [
          "accepted",
          "duplicates",
          "rejected"
        ],
        "title": "TelemetryResponse",
        "type": "object"
      },
      "TemplateImportRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "preview_image_url": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Image Url"
          },
          "preview_urls": {
            "items": {
              "maxLength": 2048,
              "type": "string"
            },
            "maxItems": 8,
            "title": "Preview Urls",
            "type": "array"
          },
          "rendering_mode": {
            "default": "static",
            "pattern": "^(ssr|static|spa)$",
            "title": "Rendering Mode",
            "type": "string"
          },
          "upload_id": {
            "format": "uuid",
            "title": "Upload Id",
            "type": "string"
          },
          "vertical": {
            "description": "Business vertical \u2014 free-text, used for filtering/suggestions",
            "maxLength": 50,
            "title": "Vertical",
            "type": "string"
          },
          "visibility": {
            "default": "private",
            "pattern": "^(private|customer)$",
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "upload_id",
          "name",
          "vertical"
        ],
        "title": "TemplateImportRequest",
        "type": "object"
      },
      "TemplateInstantiateOut": {
        "properties": {
          "deploy_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deploy Task Id"
          },
          "hosted_website_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosted Website Id"
          },
          "hosting_mode": {
            "title": "Hosting Mode",
            "type": "string"
          },
          "selected_node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Selected Node Id"
          },
          "website_config": {
            "$ref": "#/components/schemas/WebsiteConfigOut"
          }
        },
        "required": [
          "website_config",
          "hosting_mode"
        ],
        "title": "TemplateInstantiateOut",
        "type": "object"
      },
      "TemplateInstantiateRequest": {
        "properties": {
          "bootstrap_release": {
            "default": false,
            "title": "Bootstrap Release",
            "type": "boolean"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "dedicated_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedicated Instance Id"
          },
          "hosting_mode": {
            "default": "draft",
            "pattern": "^(draft|shared|dedicated)$",
            "title": "Hosting Mode",
            "type": "string"
          },
          "primary_domain": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Domain"
          },
          "site_name": {
            "anyOf": [
              {
                "maxLength": 160,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site Name"
          },
          "webhost_node_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhost Node Id"
          }
        },
        "title": "TemplateInstantiateRequest",
        "type": "object"
      },
      "TemplateListOut": {
        "properties": {
          "templates": {
            "items": {
              "$ref": "#/components/schemas/src__api__whatsapp_templates__TemplateOut"
            },
            "title": "Templates",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "templates",
          "total"
        ],
        "title": "TemplateListOut",
        "type": "object"
      },
      "TemplatePreviewArtifactOut": {
        "properties": {
          "generated": {
            "default": true,
            "title": "Generated",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "preview_html": {
            "title": "Preview Html",
            "type": "string"
          },
          "preview_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Image Url"
          },
          "preview_urls": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Preview Urls",
            "type": "array"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "preview_html"
        ],
        "title": "TemplatePreviewArtifactOut",
        "type": "object"
      },
      "TemplateUpdateRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "preview_image_url": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Image Url"
          },
          "preview_urls": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 2048,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Urls"
          },
          "vertical": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vertical"
          },
          "visibility": {
            "anyOf": [
              {
                "pattern": "^(private|customer)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility"
          }
        },
        "title": "TemplateUpdateRequest",
        "type": "object"
      },
      "TenantSheetToEntitiesRequest": {
        "properties": {
          "column_map": {
            "title": "Column Map",
            "type": "object"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Name"
          },
          "definition_slug": {
            "title": "Definition Slug",
            "type": "string"
          },
          "has_header": {
            "default": true,
            "title": "Has Header",
            "type": "boolean"
          },
          "range": {
            "default": "Sheet1",
            "title": "Range",
            "type": "string"
          },
          "spreadsheet_id": {
            "title": "Spreadsheet Id",
            "type": "string"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "required": [
          "spreadsheet_id",
          "definition_slug",
          "column_map"
        ],
        "title": "TenantSheetToEntitiesRequest",
        "type": "object"
      },
      "TenantSheetToStaffRequest": {
        "properties": {
          "column_map": {
            "title": "Column Map",
            "type": "object"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Name"
          },
          "has_header": {
            "default": true,
            "title": "Has Header",
            "type": "boolean"
          },
          "range": {
            "default": "Sheet1",
            "title": "Range",
            "type": "string"
          },
          "spreadsheet_id": {
            "title": "Spreadsheet Id",
            "type": "string"
          }
        },
        "required": [
          "spreadsheet_id",
          "column_map"
        ],
        "title": "TenantSheetToStaffRequest",
        "type": "object"
      },
      "TenantTeardownRequest": {
        "additionalProperties": false,
        "description": "Request body for tenant teardown.\n\n`extra='forbid'` so callers can't sneak `tenant_id` / `actor_user_id`\n/ etc. into the body \u2014 those come from the URL + the auth dep\n+ request.client. The only thing the body carries is the\nconfirmation phrase.",
        "properties": {
          "confirmation_phrase": {
            "description": "Literal `DELETE TENANT <tenant_slug>` where <tenant_slug> is the target tenant's actual slug. Mismatch returns 400.",
            "maxLength": 200,
            "minLength": 1,
            "title": "Confirmation Phrase",
            "type": "string"
          }
        },
        "required": [
          "confirmation_phrase"
        ],
        "title": "TenantTeardownRequest",
        "type": "object"
      },
      "TenantTeardownResponse": {
        "description": "Summary returned to the caller after a successful teardown.",
        "properties": {
          "actor_kind": {
            "title": "Actor Kind",
            "type": "string"
          },
          "deleted_at": {
            "title": "Deleted At",
            "type": "string"
          },
          "instances_terminated": {
            "title": "Instances Terminated",
            "type": "integer"
          },
          "rows_per_table": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Rows Per Table",
            "type": "object"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "tenant_name": {
            "title": "Tenant Name",
            "type": "string"
          },
          "tenant_slug": {
            "title": "Tenant Slug",
            "type": "string"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "tenant_id",
          "tenant_slug",
          "tenant_name",
          "deleted_at",
          "actor_kind",
          "instances_terminated",
          "rows_per_table",
          "warnings"
        ],
        "title": "TenantTeardownResponse",
        "type": "object"
      },
      "TenantUpdatePolicyOut": {
        "properties": {
          "maintenance_window_end_hour_utc": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Window End Hour Utc"
          },
          "maintenance_window_start_hour_utc": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Window Start Hour Utc"
          },
          "max_parallel_rollouts": {
            "default": 2,
            "title": "Max Parallel Rollouts",
            "type": "integer"
          },
          "mcp_servers_default": {
            "default": "notify",
            "title": "Mcp Servers Default",
            "type": "string"
          },
          "runtime_default": {
            "default": "notify",
            "title": "Runtime Default",
            "type": "string"
          },
          "skills_default": {
            "default": "notify",
            "title": "Skills Default",
            "type": "string"
          }
        },
        "title": "TenantUpdatePolicyOut",
        "type": "object"
      },
      "TenantUpdatePolicyRequest": {
        "properties": {
          "maintenance_window_end_hour_utc": {
            "anyOf": [
              {
                "maximum": 23.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Window End Hour Utc"
          },
          "maintenance_window_start_hour_utc": {
            "anyOf": [
              {
                "maximum": 23.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Window Start Hour Utc"
          },
          "max_parallel_rollouts": {
            "anyOf": [
              {
                "maximum": 50.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Parallel Rollouts"
          },
          "mcp_servers_default": {
            "anyOf": [
              {
                "pattern": "^(notify|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Servers Default"
          },
          "runtime_default": {
            "anyOf": [
              {
                "pattern": "^(auto|notify|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime Default"
          },
          "skills_default": {
            "anyOf": [
              {
                "pattern": "^(notify|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills Default"
          }
        },
        "title": "TenantUpdatePolicyRequest",
        "type": "object"
      },
      "TestCaseCreate": {
        "properties": {
          "expected_behavior": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Behavior"
          },
          "expected_tool_calls": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Tool Calls"
          },
          "input_message": {
            "title": "Input Message",
            "type": "string"
          },
          "sort_order": {
            "default": 0,
            "title": "Sort Order",
            "type": "integer"
          },
          "tags": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "input_message"
        ],
        "title": "TestCaseCreate",
        "type": "object"
      },
      "TestCaseOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evaluation_id": {
            "format": "uuid",
            "title": "Evaluation Id",
            "type": "string"
          },
          "expected_behavior": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Behavior"
          },
          "expected_tool_calls": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Tool Calls"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "input_message": {
            "title": "Input Message",
            "type": "string"
          },
          "sort_order": {
            "title": "Sort Order",
            "type": "integer"
          },
          "tags": {
            "items": {},
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "id",
          "evaluation_id",
          "input_message",
          "expected_behavior",
          "expected_tool_calls",
          "tags",
          "sort_order",
          "created_at"
        ],
        "title": "TestCaseOut",
        "type": "object"
      },
      "Tier": {
        "properties": {
          "alternates": {
            "items": {
              "$ref": "#/components/schemas/TierModel"
            },
            "title": "Alternates",
            "type": "array"
          },
          "best_for": {
            "items": {
              "type": "string"
            },
            "title": "Best For",
            "type": "array"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "est_cost_per_1k_convos_usd": {
            "title": "Est Cost Per 1K Convos Usd",
            "type": "number"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "platform_model": {
            "title": "Platform Model",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "description",
          "best_for",
          "est_cost_per_1k_convos_usd",
          "platform_model",
          "alternates"
        ],
        "title": "Tier",
        "type": "object"
      },
      "TierLimitsOut": {
        "properties": {
          "api_calls_remaining_monthly": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Calls Remaining Monthly"
          },
          "max_tokens_per_request": {
            "title": "Max Tokens Per Request",
            "type": "integer"
          },
          "requests_remaining_this_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requests Remaining This Minute"
          },
          "requests_remaining_today": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requests Remaining Today"
          },
          "token_allowance_remaining_monthly": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Allowance Remaining Monthly"
          }
        },
        "required": [
          "max_tokens_per_request"
        ],
        "title": "TierLimitsOut",
        "type": "object"
      },
      "TierModel": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "input_cost_per_1m": {
            "title": "Input Cost Per 1M",
            "type": "number"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "output_cost_per_1m": {
            "title": "Output Cost Per 1M",
            "type": "number"
          }
        },
        "required": [
          "id",
          "label",
          "input_cost_per_1m",
          "output_cost_per_1m"
        ],
        "title": "TierModel",
        "type": "object"
      },
      "TierOut": {
        "properties": {
          "api_call_limit": {
            "default": 10000,
            "title": "Api Call Limit",
            "type": "integer"
          },
          "billing_cycle": {
            "title": "Billing Cycle",
            "type": "string"
          },
          "conversation_limit": {
            "default": 1000,
            "title": "Conversation Limit",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_limit": {
            "default": 1,
            "title": "Instance Limit",
            "type": "integer"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "product_name": {
            "title": "Product Name",
            "type": "string"
          },
          "product_slug": {
            "title": "Product Slug",
            "type": "string"
          },
          "tier_name": {
            "title": "Tier Name",
            "type": "string"
          },
          "tier_slug": {
            "title": "Tier Slug",
            "type": "string"
          },
          "token_allowance": {
            "default": 100000,
            "title": "Token Allowance",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "product_slug",
          "product_name",
          "tier_slug",
          "tier_name",
          "price_cents",
          "billing_cycle"
        ],
        "title": "TierOut",
        "type": "object"
      },
      "TierPricingCreateIn": {
        "description": "Create or update tier pricing for end-customers.\n\"Greed, for lack of a better word, is good.\" \u2014 Gordon Gekko, Wall Street",
        "properties": {
          "billing_interval": {
            "default": "month",
            "pattern": "^(month|year)$",
            "title": "Billing Interval",
            "type": "string"
          },
          "currency": {
            "default": "usd",
            "maxLength": 3,
            "title": "Currency",
            "type": "string"
          },
          "customer_price_cents": {
            "minimum": 0.0,
            "title": "Customer Price Cents",
            "type": "integer"
          },
          "platform_fee_percent": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "default": "20.00",
            "title": "Platform Fee Percent"
          },
          "product_tier_id": {
            "format": "uuid",
            "title": "Product Tier Id",
            "type": "string"
          }
        },
        "required": [
          "product_tier_id",
          "customer_price_cents"
        ],
        "title": "TierPricingCreateIn",
        "type": "object"
      },
      "TierPricingListOut": {
        "properties": {
          "pricing": {
            "items": {
              "$ref": "#/components/schemas/TierPricingOut"
            },
            "title": "Pricing",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "pricing",
          "total"
        ],
        "title": "TierPricingListOut",
        "type": "object"
      },
      "TierPricingOut": {
        "properties": {
          "billing_interval": {
            "title": "Billing Interval",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "customer_price_cents": {
            "title": "Customer Price Cents",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "platform_fee_percent": {
            "title": "Platform Fee Percent",
            "type": "string"
          },
          "product_name": {
            "title": "Product Name",
            "type": "string"
          },
          "product_tier_id": {
            "title": "Product Tier Id",
            "type": "string"
          },
          "stripe_price_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Price Id"
          },
          "tier_name": {
            "title": "Tier Name",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "product_tier_id",
          "tier_name",
          "product_name",
          "customer_price_cents",
          "platform_fee_percent",
          "currency",
          "stripe_price_id",
          "billing_interval",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "TierPricingOut",
        "type": "object"
      },
      "TierPricingUpdateIn": {
        "properties": {
          "billing_interval": {
            "anyOf": [
              {
                "pattern": "^(month|year)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Interval"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 3,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "customer_price_cents": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Price Cents"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "platform_fee_percent": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Fee Percent"
          }
        },
        "title": "TierPricingUpdateIn",
        "type": "object"
      },
      "TiersResponse": {
        "properties": {
          "default_tier": {
            "title": "Default Tier",
            "type": "string"
          },
          "tiers": {
            "items": {
              "$ref": "#/components/schemas/Tier"
            },
            "title": "Tiers",
            "type": "array"
          }
        },
        "required": [
          "tiers",
          "default_tier"
        ],
        "title": "TiersResponse",
        "type": "object"
      },
      "TimesheetApproval": {
        "properties": {
          "approval_status": {
            "description": "One of: ('pending', 'approved', 'rejected')",
            "title": "Approval Status",
            "type": "string"
          },
          "approved_by": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved By"
          }
        },
        "required": [
          "approval_status"
        ],
        "title": "TimesheetApproval",
        "type": "object"
      },
      "TimesheetCreate": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "date": {
            "format": "date",
            "title": "Date",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hours": {
            "exclusiveMinimum": 0.0,
            "title": "Hours",
            "type": "number"
          },
          "job_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Id"
          },
          "person_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Person Id"
          },
          "rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate"
          },
          "shift_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shift Id"
          }
        },
        "required": [
          "customer_id",
          "date",
          "hours"
        ],
        "title": "TimesheetCreate",
        "type": "object"
      },
      "TokenResponse": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "email_verified": {
            "default": true,
            "title": "Email Verified",
            "type": "boolean"
          },
          "expires_in": {
            "default": 1800,
            "title": "Expires In",
            "type": "integer"
          },
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "refresh_token"
        ],
        "title": "TokenResponse",
        "type": "object"
      },
      "TrialStatusOut": {
        "description": "Lightweight trial status for sidebar countdown.\n\n\"Time is an illusion. Lunchtime doubly so.\"\n\u2014 Ford Prefect, The Hitchhiker's Guide to the Galaxy",
        "properties": {
          "plan_name": {
            "default": "No Plan",
            "title": "Plan Name",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "trial_days_remaining": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Days Remaining"
          },
          "trial_ends_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Ends At"
          },
          "trial_expired": {
            "default": false,
            "title": "Trial Expired",
            "type": "boolean"
          },
          "upgrade_url": {
            "default": "/billing",
            "title": "Upgrade Url",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "TrialStatusOut",
        "type": "object"
      },
      "TriggerConfig": {
        "description": "Per-event toggle. All default to True if not set.",
        "properties": {
          "billing_setup_reminder": {
            "default": true,
            "title": "Billing Setup Reminder",
            "type": "boolean"
          },
          "customer_welcome": {
            "default": true,
            "title": "Customer Welcome",
            "type": "boolean"
          },
          "instance_deployed": {
            "default": true,
            "title": "Instance Deployed",
            "type": "boolean"
          },
          "instance_error": {
            "default": true,
            "title": "Instance Error",
            "type": "boolean"
          },
          "instance_recovered": {
            "default": true,
            "title": "Instance Recovered",
            "type": "boolean"
          },
          "trial_expiring": {
            "default": true,
            "title": "Trial Expiring",
            "type": "boolean"
          },
          "weekly_digest": {
            "default": true,
            "title": "Weekly Digest",
            "type": "boolean"
          },
          "welcome": {
            "default": true,
            "title": "Welcome",
            "type": "boolean"
          }
        },
        "title": "TriggerConfig",
        "type": "object"
      },
      "TriggerConfigOut": {
        "description": "Response includes the resolved config plus event metadata.",
        "properties": {
          "events": {
            "items": {
              "type": "object"
            },
            "title": "Events",
            "type": "array"
          },
          "triggers": {
            "$ref": "#/components/schemas/TriggerConfig"
          }
        },
        "required": [
          "triggers",
          "events"
        ],
        "title": "TriggerConfigOut",
        "type": "object"
      },
      "TriggerCreateRequest": {
        "properties": {
          "action_config": {
            "title": "Action Config",
            "type": "object"
          },
          "action_type": {
            "description": "notify|send_webhook|run_workflow|log_event|require_approval",
            "title": "Action Type",
            "type": "string"
          },
          "conditions": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conditions"
          },
          "cron": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "event": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event"
          },
          "interval_seconds": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interval Seconds"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "schedule_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'cron' or 'interval'",
            "title": "Schedule Type"
          },
          "timezone": {
            "default": "UTC",
            "title": "Timezone",
            "type": "string"
          },
          "trigger_type": {
            "description": "'schedule' or 'event'",
            "title": "Trigger Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "trigger_type",
          "action_type"
        ],
        "title": "TriggerCreateRequest",
        "type": "object"
      },
      "TriggerOut": {
        "properties": {
          "actions": {
            "default": [],
            "items": {
              "type": "object"
            },
            "title": "Actions",
            "type": "array"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "event": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "last_triggered_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Triggered At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "schedule": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "trigger_count": {
            "default": 0,
            "title": "Trigger Count",
            "type": "integer"
          },
          "trigger_type": {
            "title": "Trigger Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "trigger_type",
          "source",
          "created_at"
        ],
        "title": "TriggerOut",
        "type": "object"
      },
      "TriggerPatchRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "TriggerPatchRequest",
        "type": "object"
      },
      "TriggerTypeOut": {
        "properties": {
          "description": {
            "title": "Description",
            "type": "string"
          },
          "event": {
            "title": "Event",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "payload_fields": {
            "items": {
              "type": "object"
            },
            "title": "Payload Fields",
            "type": "array"
          }
        },
        "required": [
          "event",
          "label",
          "description",
          "payload_fields"
        ],
        "title": "TriggerTypeOut",
        "type": "object"
      },
      "TriggersListResponse": {
        "properties": {
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/TriggerOut"
            },
            "title": "Triggers",
            "type": "array"
          }
        },
        "required": [
          "triggers",
          "total"
        ],
        "title": "TriggersListResponse",
        "type": "object"
      },
      "UnificationRuleCreate": {
        "properties": {
          "channel": {
            "maxLength": 30,
            "title": "Channel",
            "type": "string"
          },
          "confidence": {
            "default": "confirmed",
            "pattern": "^(confirmed|inferred|agent_linked)$",
            "title": "Confidence",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "external_identifier": {
            "maxLength": 255,
            "title": "External Identifier",
            "type": "string"
          },
          "unified_person_id": {
            "format": "uuid",
            "title": "Unified Person Id",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "unified_person_id",
          "channel",
          "external_identifier"
        ],
        "title": "UnificationRuleCreate",
        "type": "object"
      },
      "UpdateConfigRequest": {
        "properties": {
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "customer_facing_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Facing Prompt"
          },
          "model_temperature": {
            "anyOf": [
              {
                "maximum": 2.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Temperature"
          },
          "recipe_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipe Id"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          },
          "telegram_bot_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Telegram Bot Token"
          },
          "workflow_slugs": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Slugs"
          }
        },
        "title": "UpdateConfigRequest",
        "type": "object"
      },
      "UpdateModelPolicyRequest": {
        "description": "Update the model policy for an instance.",
        "properties": {
          "budget_daily_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Daily Usd"
          },
          "budget_monthly_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Monthly Usd"
          },
          "embedding_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Model"
          },
          "fallbacks": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallbacks"
          },
          "max_tokens": {
            "anyOf": [
              {
                "maximum": 200000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "primary": {
            "anyOf": [
              {
                "pattern": "^[a-z][a-z0-9_-]+/[a-zA-Z0-9._-]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary"
          },
          "temperature": {
            "anyOf": [
              {
                "maximum": 2.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          }
        },
        "title": "UpdateModelPolicyRequest",
        "type": "object"
      },
      "UpdatePolicyOut": {
        "description": "Per-component update policy.\n\nauto_supported indicates which channels have a working auto-update\npath. The frontend should disable the 'auto' option for channels\nwhere auto_supported is False.",
        "properties": {
          "mcp_servers": {
            "default": "notify",
            "title": "Mcp Servers",
            "type": "string"
          },
          "mcp_servers_auto_supported": {
            "default": false,
            "title": "Mcp Servers Auto Supported",
            "type": "boolean"
          },
          "mcp_servers_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Servers Override"
          },
          "mcp_servers_source": {
            "default": "platform_default",
            "title": "Mcp Servers Source",
            "type": "string"
          },
          "runtime": {
            "default": "notify",
            "title": "Runtime",
            "type": "string"
          },
          "runtime_auto_supported": {
            "default": true,
            "title": "Runtime Auto Supported",
            "type": "boolean"
          },
          "runtime_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime Override"
          },
          "runtime_source": {
            "default": "platform_default",
            "title": "Runtime Source",
            "type": "string"
          },
          "skills": {
            "default": "notify",
            "title": "Skills",
            "type": "string"
          },
          "skills_auto_supported": {
            "default": false,
            "title": "Skills Auto Supported",
            "type": "boolean"
          },
          "skills_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills Override"
          },
          "skills_source": {
            "default": "platform_default",
            "title": "Skills Source",
            "type": "string"
          }
        },
        "title": "UpdatePolicyOut",
        "type": "object"
      },
      "UpdatePolicyRequest": {
        "description": "Set update policy per component type.\n\nNote: 'auto' is only valid for runtime. Skills and MCP servers\ndo not yet have an auto-update path \u2014 setting 'auto' on them\nwill be rejected until the marketplace version system is built.",
        "properties": {
          "mcp_servers": {
            "anyOf": [
              {
                "pattern": "^(inherit|notify|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Servers"
          },
          "runtime": {
            "anyOf": [
              {
                "pattern": "^(inherit|auto|notify|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime"
          },
          "skills": {
            "anyOf": [
              {
                "pattern": "^(inherit|notify|disabled)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills"
          }
        },
        "title": "UpdatePolicyRequest",
        "type": "object"
      },
      "UpdateProfileRequest": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          }
        },
        "title": "UpdateProfileRequest",
        "type": "object"
      },
      "UploadOut": {
        "description": "Custom site upload metadata.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "detected_framework": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detected Framework"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "has_index_html": {
            "title": "Has Index Html",
            "type": "boolean"
          },
          "has_package_json": {
            "title": "Has Package Json",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "preview_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Url"
          },
          "scan_findings": {
            "default": [],
            "items": {},
            "title": "Scan Findings",
            "type": "array"
          },
          "scan_status": {
            "default": "pending",
            "title": "Scan Status",
            "type": "string"
          },
          "scan_threat_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scan Threat Level"
          },
          "sha256_hash": {
            "title": "Sha256 Hash",
            "type": "string"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "validation_errors": {
            "default": [],
            "items": {},
            "title": "Validation Errors",
            "type": "array"
          },
          "validation_status": {
            "title": "Validation Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "filename",
          "content_type",
          "size_bytes",
          "sha256_hash",
          "validation_status",
          "has_index_html",
          "has_package_json",
          "is_active",
          "created_at"
        ],
        "title": "UploadOut",
        "type": "object"
      },
      "UploadUrlRequest": {
        "properties": {
          "content_type": {
            "description": "MIME type of the file",
            "title": "Content Type",
            "type": "string"
          },
          "field_id": {
            "description": "Form field ID requesting upload",
            "maxLength": 100,
            "title": "Field Id",
            "type": "string"
          },
          "filename": {
            "description": "Original filename",
            "maxLength": 255,
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "field_id",
          "content_type",
          "filename"
        ],
        "title": "UploadUrlRequest",
        "type": "object"
      },
      "UsageChartOut": {
        "properties": {
          "period_label": {
            "title": "Period Label",
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/UsageChartPoint"
            },
            "title": "Points",
            "type": "array"
          }
        },
        "required": [
          "points",
          "period_label"
        ],
        "title": "UsageChartOut",
        "type": "object"
      },
      "UsageChartPoint": {
        "properties": {
          "cost_usd": {
            "title": "Cost Usd",
            "type": "string"
          },
          "date": {
            "title": "Date",
            "type": "string"
          },
          "requests": {
            "title": "Requests",
            "type": "integer"
          },
          "tokens": {
            "title": "Tokens",
            "type": "integer"
          }
        },
        "required": [
          "date",
          "requests",
          "tokens",
          "cost_usd"
        ],
        "title": "UsageChartPoint",
        "type": "object"
      },
      "UsageDetailOut": {
        "description": "Detailed usage breakdown for the current billing period.",
        "properties": {
          "by_instance": {
            "items": {
              "type": "object"
            },
            "title": "By Instance",
            "type": "array"
          },
          "period_end": {
            "title": "Period End",
            "type": "string"
          },
          "period_start": {
            "title": "Period Start",
            "type": "string"
          },
          "platform_cost_usd": {
            "title": "Platform Cost Usd",
            "type": "string"
          },
          "token_allowance_monthly": {
            "title": "Token Allowance Monthly",
            "type": "integer"
          },
          "token_usage_pct": {
            "title": "Token Usage Pct",
            "type": "number"
          },
          "total_cost_usd": {
            "title": "Total Cost Usd",
            "type": "string"
          },
          "total_requests": {
            "title": "Total Requests",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "unique_end_users": {
            "title": "Unique End Users",
            "type": "integer"
          }
        },
        "required": [
          "total_requests",
          "total_tokens",
          "total_cost_usd",
          "platform_cost_usd",
          "unique_end_users",
          "period_start",
          "period_end",
          "token_allowance_monthly",
          "token_usage_pct",
          "by_instance"
        ],
        "title": "UsageDetailOut",
        "type": "object"
      },
      "UsageEventIn": {
        "description": "Single LLM usage event from the VPS agent.",
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "end_user_ext_id": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End User Ext Id"
          },
          "estimated_tokens_in": {
            "minimum": 0.0,
            "title": "Estimated Tokens In",
            "type": "integer"
          },
          "estimated_tokens_out": {
            "minimum": 0.0,
            "title": "Estimated Tokens Out",
            "type": "integer"
          },
          "event_ts": {
            "format": "date-time",
            "title": "Event Ts",
            "type": "string"
          },
          "hold_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hold Id"
          },
          "key_source": {
            "pattern": "^(platform|tenant|end_user)$",
            "title": "Key Source",
            "type": "string"
          },
          "model": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Model",
            "type": "string"
          },
          "provider": {
            "maxLength": 50,
            "minLength": 1,
            "title": "Provider",
            "type": "string"
          },
          "provider_cost_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Cost Usd"
          },
          "provider_tokens_in": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Tokens In"
          },
          "provider_tokens_out": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Tokens Out"
          },
          "request_id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "provider",
          "model",
          "key_source",
          "estimated_tokens_in",
          "estimated_tokens_out",
          "event_ts"
        ],
        "title": "UsageEventIn",
        "type": "object"
      },
      "UsagePeriodOut": {
        "description": "Usage metrics for the current billing period.\n\nNote: webhost_nodes and total_hosted_sites are tenant-wide aggregates\n(not customer-scoped) because hosting infrastructure is provisioned at the\ntenant level. All other usage fields are customer-scoped via subscription.",
        "properties": {
          "active_instances": {
            "title": "Active Instances",
            "type": "integer"
          },
          "api_call_limit": {
            "default": 10000,
            "title": "Api Call Limit",
            "type": "integer"
          },
          "conversation_limit": {
            "default": 1000,
            "title": "Conversation Limit",
            "type": "integer"
          },
          "instance_limit": {
            "title": "Instance Limit",
            "type": "integer"
          },
          "max_sites_per_node": {
            "default": 25,
            "title": "Max Sites Per Node",
            "type": "integer"
          },
          "platform_cost_usd": {
            "title": "Platform Cost Usd",
            "type": "string"
          },
          "token_allowance": {
            "default": 100000,
            "title": "Token Allowance",
            "type": "integer"
          },
          "total_cost_usd": {
            "title": "Total Cost Usd",
            "type": "string"
          },
          "total_hosted_sites": {
            "default": 0,
            "title": "Total Hosted Sites",
            "type": "integer"
          },
          "total_requests": {
            "title": "Total Requests",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "unique_end_users": {
            "title": "Unique End Users",
            "type": "integer"
          },
          "webhost_nodes": {
            "default": 0,
            "title": "Webhost Nodes",
            "type": "integer"
          }
        },
        "required": [
          "total_requests",
          "total_tokens",
          "total_cost_usd",
          "platform_cost_usd",
          "unique_end_users",
          "active_instances",
          "instance_limit"
        ],
        "title": "UsagePeriodOut",
        "type": "object"
      },
      "UsagePointOut": {
        "description": "Single day in the usage time-series.",
        "properties": {
          "date": {
            "title": "Date",
            "type": "string"
          },
          "estimated_cost_usd": {
            "title": "Estimated Cost Usd",
            "type": "string"
          },
          "requests": {
            "title": "Requests",
            "type": "integer"
          },
          "tokens_in": {
            "title": "Tokens In",
            "type": "integer"
          },
          "tokens_out": {
            "title": "Tokens Out",
            "type": "integer"
          }
        },
        "required": [
          "date",
          "requests",
          "tokens_in",
          "tokens_out",
          "estimated_cost_usd"
        ],
        "title": "UsagePointOut",
        "type": "object"
      },
      "UsageTimeSeriesOut": {
        "description": "Time-series usage data with zero-fill.",
        "properties": {
          "period_days": {
            "title": "Period Days",
            "type": "integer"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/UsagePointOut"
            },
            "title": "Points",
            "type": "array"
          }
        },
        "required": [
          "points",
          "period_days"
        ],
        "title": "UsageTimeSeriesOut",
        "type": "object"
      },
      "ValidateKeyRequest": {
        "properties": {
          "api_key": {
            "maxLength": 500,
            "minLength": 8,
            "title": "Api Key",
            "type": "string"
          },
          "provider_id": {
            "maxLength": 50,
            "minLength": 1,
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "provider_id",
          "api_key"
        ],
        "title": "ValidateKeyRequest",
        "type": "object"
      },
      "ValidateKeyResponse": {
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "provider_id": {
            "title": "Provider Id",
            "type": "string"
          },
          "valid": {
            "title": "Valid",
            "type": "boolean"
          }
        },
        "required": [
          "valid",
          "provider_id",
          "message"
        ],
        "title": "ValidateKeyResponse",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "VerifyEmailRequest": {
        "properties": {
          "code": {
            "maxLength": 6,
            "minLength": 6,
            "title": "Code",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "title": "VerifyEmailRequest",
        "type": "object"
      },
      "VerifyPinRequest": {
        "description": "Verify a PIN \u2014 used by the agent runtime during tool execution.",
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "identity_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Identity Id"
          },
          "pin": {
            "title": "Pin",
            "type": "string"
          }
        },
        "required": [
          "pin"
        ],
        "title": "VerifyPinRequest",
        "type": "object"
      },
      "VerifyRequest": {
        "properties": {
          "channel_address": {
            "title": "Channel Address",
            "type": "string"
          },
          "channel_type": {
            "title": "Channel Type",
            "type": "string"
          },
          "response": {
            "description": "Worker's verification response",
            "title": "Response",
            "type": "string"
          }
        },
        "required": [
          "channel_type",
          "channel_address",
          "response"
        ],
        "title": "VerifyRequest",
        "type": "object"
      },
      "VoiceSetup": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Retell agent/assistant ID",
            "title": "Agent Id"
          },
          "anthropic_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Anthropic API key for LLM",
            "title": "Anthropic Api Key"
          },
          "api_key": {
            "default": "",
            "description": "Provider API key (Retell) \u2014 stored encrypted",
            "title": "Api Key",
            "type": "string"
          },
          "cartesia_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cartesia API key for TTS",
            "title": "Cartesia Api Key"
          },
          "deepgram_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deepgram API key for STT",
            "title": "Deepgram Api Key"
          },
          "elevenlabs_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ElevenLabs API key for TTS",
            "title": "Elevenlabs Api Key"
          },
          "google_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Google API key for LLM/STT/TTS",
            "title": "Google Api Key"
          },
          "openai_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "OpenAI API key for LLM/TTS/STT",
            "title": "Openai Api Key"
          },
          "phone_number": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Phone number for inbound calls",
            "title": "Phone Number"
          },
          "provider": {
            "default": "retell",
            "description": "Voice provider slug (retell, pipecat)",
            "title": "Provider",
            "type": "string"
          },
          "twilio_account_sid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Twilio Account SID",
            "title": "Twilio Account Sid"
          },
          "twilio_auth_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Twilio Auth Token",
            "title": "Twilio Auth Token"
          },
          "twilio_phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Twilio phone number (E.164)",
            "title": "Twilio Phone Number"
          },
          "webhook_secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Provider webhook signing secret",
            "title": "Webhook Secret"
          }
        },
        "title": "VoiceSetup",
        "type": "object"
      },
      "VoiceStatusOut": {
        "properties": {
          "active_calls": {
            "default": 0,
            "title": "Active Calls",
            "type": "integer"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "webhook_url": {
            "title": "Webhook Url",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "webhook_url",
          "status"
        ],
        "title": "VoiceStatusOut",
        "type": "object"
      },
      "WebHostCapacityOut": {
        "properties": {
          "available_sites": {
            "title": "Available Sites",
            "type": "integer"
          },
          "capacity_sites": {
            "title": "Capacity Sites",
            "type": "integer"
          },
          "node_id": {
            "format": "uuid",
            "title": "Node Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "used_sites": {
            "title": "Used Sites",
            "type": "integer"
          }
        },
        "required": [
          "node_id",
          "status",
          "capacity_sites",
          "used_sites",
          "available_sites"
        ],
        "title": "WebHostCapacityOut",
        "type": "object"
      },
      "WebHostNodeCreate": {
        "properties": {
          "capacity_sites": {
            "default": 25,
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Capacity Sites",
            "type": "integer"
          },
          "host_instance_id": {
            "format": "uuid",
            "title": "Host Instance Id",
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "host_instance_id",
          "name"
        ],
        "title": "WebHostNodeCreate",
        "type": "object"
      },
      "WebHostNodeOut": {
        "properties": {
          "capacity_sites": {
            "title": "Capacity Sites",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "host_instance_id": {
            "format": "uuid",
            "title": "Host Instance Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "metadata_json": {
            "title": "Metadata Json",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "region_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "used_sites": {
            "title": "Used Sites",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "host_instance_id",
          "name",
          "status",
          "capacity_sites",
          "used_sites",
          "created_at",
          "updated_at"
        ],
        "title": "WebHostNodeOut",
        "type": "object"
      },
      "WebHostNodeTelemetryOut": {
        "properties": {
          "app_sites": {
            "default": 0,
            "title": "App Sites",
            "type": "integer"
          },
          "collected_at": {
            "format": "date-time",
            "title": "Collected At",
            "type": "string"
          },
          "disk_available_bytes": {
            "default": 0,
            "title": "Disk Available Bytes",
            "type": "integer"
          },
          "disk_total_bytes": {
            "default": 0,
            "title": "Disk Total Bytes",
            "type": "integer"
          },
          "disk_used_bytes": {
            "default": 0,
            "title": "Disk Used Bytes",
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "host_instance_id": {
            "format": "uuid",
            "title": "Host Instance Id",
            "type": "string"
          },
          "host_instance_status": {
            "title": "Host Instance Status",
            "type": "string"
          },
          "keep_bytes_budget": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keep Bytes Budget"
          },
          "keep_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keep Count"
          },
          "live_sites": {
            "default": 0,
            "title": "Live Sites",
            "type": "integer"
          },
          "node_id": {
            "format": "uuid",
            "title": "Node Id",
            "type": "string"
          },
          "reachable": {
            "title": "Reachable",
            "type": "boolean"
          },
          "release_bytes": {
            "default": 0,
            "title": "Release Bytes",
            "type": "integer"
          },
          "release_count": {
            "default": 0,
            "title": "Release Count",
            "type": "integer"
          },
          "total_sites": {
            "default": 0,
            "title": "Total Sites",
            "type": "integer"
          }
        },
        "required": [
          "node_id",
          "host_instance_id",
          "host_instance_status",
          "reachable"
        ],
        "title": "WebHostNodeTelemetryOut",
        "type": "object"
      },
      "WebsiteConfigOut": {
        "description": "Per-instance website configuration.",
        "properties": {
          "content_mode": {
            "default": "bundle",
            "title": "Content Mode",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "custom_upload_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Upload Id"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "deployed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed At"
          },
          "deployed_instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed Instance Id"
          },
          "faq": {
            "default": [],
            "items": {},
            "title": "Faq",
            "type": "array"
          },
          "features": {
            "default": [],
            "items": {},
            "title": "Features",
            "type": "array"
          },
          "hero_cta_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hero Cta Text"
          },
          "hero_subtitle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hero Subtitle"
          },
          "hero_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hero Title"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "is_primary": {
            "default": true,
            "title": "Is Primary",
            "type": "boolean"
          },
          "pricing_currency": {
            "default": "USD",
            "title": "Pricing Currency",
            "type": "string"
          },
          "pricing_plans": {
            "default": [],
            "items": {},
            "title": "Pricing Plans",
            "type": "array"
          },
          "robots_txt_custom": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Robots Txt Custom"
          },
          "seo_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Description"
          },
          "seo_keywords": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Keywords"
          },
          "seo_og_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Og Image Url"
          },
          "seo_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Title"
          },
          "sitemap_enabled": {
            "default": true,
            "title": "Sitemap Enabled",
            "type": "boolean"
          },
          "status": {
            "default": "draft",
            "title": "Status",
            "type": "string"
          },
          "stripe_connect_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Connect Account Id"
          },
          "stripe_publishable_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Publishable Key"
          },
          "template_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "testimonials": {
            "default": [],
            "items": {},
            "title": "Testimonials",
            "type": "array"
          },
          "trial_days": {
            "default": 14,
            "title": "Trial Days",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "created_at",
          "updated_at"
        ],
        "title": "WebsiteConfigOut",
        "type": "object"
      },
      "WebsiteConfigUpdate": {
        "description": "Partial update for website config.\n\n\"You can't handle the truth!\" \u2014 Col. Jessup\n(about SEO meta descriptions exceeding 160 chars)",
        "properties": {
          "content_mode": {
            "anyOf": [
              {
                "pattern": "^(bundle|pages)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Mode"
          },
          "custom_upload_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Upload Id"
          },
          "customer_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "faq": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Faq"
          },
          "features": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Features"
          },
          "hero_cta_text": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hero Cta Text"
          },
          "hero_subtitle": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hero Subtitle"
          },
          "hero_title": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hero Title"
          },
          "is_primary": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Primary"
          },
          "pricing_currency": {
            "anyOf": [
              {
                "maxLength": 3,
                "minLength": 3,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Currency"
          },
          "pricing_plans": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Plans"
          },
          "robots_txt_custom": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Robots Txt Custom"
          },
          "seo_description": {
            "anyOf": [
              {
                "maxLength": 160,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Description"
          },
          "seo_keywords": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Keywords"
          },
          "seo_og_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Og Image Url"
          },
          "seo_title": {
            "anyOf": [
              {
                "maxLength": 70,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Title"
          },
          "sitemap_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sitemap Enabled"
          },
          "stripe_connect_account_id": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Connect Account Id"
          },
          "stripe_publishable_key": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Publishable Key"
          },
          "template_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "testimonials": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Testimonials"
          },
          "trial_days": {
            "anyOf": [
              {
                "maximum": 365.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Days"
          }
        },
        "title": "WebsiteConfigUpdate",
        "type": "object"
      },
      "WebsiteHistoryOut": {
        "properties": {
          "artifact_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Artifact Hash"
          },
          "change_source": {
            "title": "Change Source",
            "type": "string"
          },
          "commit_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commit Sha"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "deployed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "release_id": {
            "title": "Release Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "release_id",
          "change_source",
          "status",
          "created_at"
        ],
        "title": "WebsiteHistoryOut",
        "type": "object"
      },
      "WebsiteReleaseOut": {
        "properties": {
          "actor_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "artifact_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Artifact Hash"
          },
          "change_source": {
            "title": "Change Source",
            "type": "string"
          },
          "commit_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commit Sha"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "deployed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed At"
          },
          "hosted_website_id": {
            "format": "uuid",
            "title": "Hosted Website Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "metadata_json": {
            "title": "Metadata Json",
            "type": "object"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "release_id": {
            "title": "Release Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "hosted_website_id",
          "release_id",
          "change_source",
          "status",
          "created_at"
        ],
        "title": "WebsiteReleaseOut",
        "type": "object"
      },
      "WebsiteRollbackRequest": {
        "properties": {
          "git_ref": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Git Ref"
          },
          "release_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Release Id"
          }
        },
        "title": "WebsiteRollbackRequest",
        "type": "object"
      },
      "WhatsAppSetup": {
        "properties": {
          "access_token": {
            "description": "WABA access token (stored encrypted via MCP credentials)",
            "title": "Access Token",
            "type": "string"
          },
          "app_secret": {
            "description": "Meta App Secret for X-Hub-Signature-256 verification on POST webhooks",
            "title": "App Secret",
            "type": "string"
          },
          "display_phone": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display phone number (e.g. +61400111222)",
            "title": "Display Phone"
          },
          "phone_number_id": {
            "description": "Meta phone number ID from Embedded Signup",
            "title": "Phone Number Id",
            "type": "string"
          },
          "verify_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom verify token for GET webhook challenge. Auto-generated if not provided.",
            "title": "Verify Token"
          }
        },
        "required": [
          "phone_number_id",
          "access_token",
          "app_secret"
        ],
        "title": "WhatsAppSetup",
        "type": "object"
      },
      "WhatsAppStatusOut": {
        "properties": {
          "display_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Phone"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "phone_number_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "webhook_url": {
            "title": "Webhook Url",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "webhook_url",
          "status"
        ],
        "title": "WhatsAppStatusOut",
        "type": "object"
      },
      "WidgetChatRequest": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "message": {
            "maxLength": 8000,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "WidgetChatRequest",
        "type": "object"
      },
      "WorkerTimesheetCreate": {
        "properties": {
          "date": {
            "format": "date",
            "title": "Date",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hours": {
            "exclusiveMinimum": 0.0,
            "title": "Hours",
            "type": "number"
          },
          "job_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Id"
          },
          "rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate"
          },
          "shift_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shift Id"
          }
        },
        "required": [
          "date",
          "hours"
        ],
        "title": "WorkerTimesheetCreate",
        "type": "object"
      },
      "WorkflowActivateRequest": {
        "properties": {
          "signer": {
            "description": "Identity of the signer (tenant admin, Haldir)",
            "maxLength": 200,
            "title": "Signer",
            "type": "string"
          }
        },
        "required": [
          "signer"
        ],
        "title": "WorkflowActivateRequest",
        "type": "object"
      },
      "WorkflowAdvance": {
        "properties": {
          "action": {
            "description": "Audit action name (e.g. 'escalated', 'approved', 'contacted_tier2')",
            "title": "Action",
            "type": "string"
          },
          "action_detail": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action Detail"
          },
          "actor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor"
          },
          "approver_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approver Id"
          },
          "assigned_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned To"
          },
          "escalation_level": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Escalation Level"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "next_action_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Action At"
          },
          "stage": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New stage",
            "title": "Stage"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New status: ('active', 'awaiting_approval', 'paused', 'suspended', 'completed', 'expired', 'cancelled', 'failed')",
            "title": "Status"
          },
          "workflow_state": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Merge into existing state",
            "title": "Workflow State"
          }
        },
        "required": [
          "action"
        ],
        "title": "WorkflowAdvance",
        "type": "object"
      },
      "WorkflowListOut": {
        "properties": {
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "per_page": {
            "title": "Per Page",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "workflows": {
            "items": {
              "$ref": "#/components/schemas/src__api__workflows__WorkflowOut"
            },
            "title": "Workflows",
            "type": "array"
          }
        },
        "required": [
          "workflows",
          "total",
          "page",
          "per_page"
        ],
        "title": "WorkflowListOut",
        "type": "object"
      },
      "WorkflowUpdate": {
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "WorkflowUpdate",
        "type": "object"
      },
      "XeroInvoiceCreate": {
        "properties": {
          "contact_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Email"
          },
          "contact_name": {
            "title": "Contact Name",
            "type": "string"
          },
          "currency_code": {
            "default": "AUD",
            "title": "Currency Code",
            "type": "string"
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due Date"
          },
          "line_items": {
            "items": {
              "type": "object"
            },
            "title": "Line Items",
            "type": "array"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          }
        },
        "required": [
          "contact_name",
          "line_items"
        ],
        "title": "XeroInvoiceCreate",
        "type": "object"
      },
      "src__api__billing__PlanOut": {
        "description": "Current subscription plan details.\n\n\"Listen, I'm a politician, which means I'm a cheat and a liar,\nand when I'm not kissing babies I'm stealing their lollipops.\"\n\u2014 The President, The Naked Gun 2\u00bd",
        "properties": {
          "api_call_limit": {
            "default": 10000,
            "title": "Api Call Limit",
            "type": "integer"
          },
          "billing_cycle": {
            "title": "Billing Cycle",
            "type": "string"
          },
          "conversation_limit": {
            "default": 1000,
            "title": "Conversation Limit",
            "type": "integer"
          },
          "current_period_end": {
            "title": "Current Period End",
            "type": "string"
          },
          "current_period_start": {
            "title": "Current Period Start",
            "type": "string"
          },
          "instance_limit": {
            "default": 1,
            "title": "Instance Limit",
            "type": "integer"
          },
          "max_sites_per_node": {
            "default": 25,
            "title": "Max Sites Per Node",
            "type": "integer"
          },
          "plan_name": {
            "title": "Plan Name",
            "type": "string"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "product_name": {
            "title": "Product Name",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tier_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier Id"
          },
          "tier_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier Slug"
          },
          "token_allowance": {
            "default": 100000,
            "title": "Token Allowance",
            "type": "integer"
          },
          "trial_days_remaining": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Days Remaining"
          },
          "trial_ends_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Ends At"
          }
        },
        "required": [
          "plan_name",
          "product_name",
          "price_cents",
          "billing_cycle",
          "status",
          "trial_ends_at",
          "trial_days_remaining",
          "current_period_start",
          "current_period_end"
        ],
        "title": "PlanOut",
        "type": "object"
      },
      "src__api__catalog__SkillOut": {
        "properties": {
          "category": {
            "title": "Category",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "emoji": {
            "title": "Emoji",
            "type": "string"
          },
          "min_role": {
            "title": "Min Role",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "required_by_presets": {
            "items": {
              "type": "string"
            },
            "title": "Required By Presets",
            "type": "array"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "used_by_presets": {
            "items": {
              "type": "string"
            },
            "title": "Used By Presets",
            "type": "array"
          },
          "user_invocable": {
            "title": "User Invocable",
            "type": "boolean"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name",
          "description",
          "emoji",
          "version",
          "category",
          "source",
          "user_invocable",
          "min_role",
          "used_by_presets",
          "required_by_presets"
        ],
        "title": "SkillOut",
        "type": "object"
      },
      "src__api__connections__GrantOut": {
        "properties": {
          "capabilities": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Capabilities",
            "type": "array"
          },
          "connection_id": {
            "format": "uuid",
            "title": "Connection Id",
            "type": "string"
          },
          "granted_at": {
            "format": "date-time",
            "title": "Granted At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "connection_id",
          "instance_id",
          "granted_at"
        ],
        "title": "GrantOut",
        "type": "object"
      },
      "src__api__customer_identities__IdentityLookupOut": {
        "description": "Response for reverse lookup: channel + external_id \u2192 customer.",
        "properties": {
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "customer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Email"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "identity_id": {
            "format": "uuid",
            "title": "Identity Id",
            "type": "string"
          },
          "role_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role Override"
          },
          "verified": {
            "title": "Verified",
            "type": "boolean"
          }
        },
        "required": [
          "customer_id",
          "identity_id",
          "verified",
          "channel",
          "external_id"
        ],
        "title": "IdentityLookupOut",
        "type": "object"
      },
      "src__api__customer_signup__PlanOut": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "title": "Features",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          }
        },
        "required": [
          "name"
        ],
        "title": "PlanOut",
        "type": "object"
      },
      "src__api__debug_access__GrantOut": {
        "properties": {
          "duration_hours": {
            "title": "Duration Hours",
            "type": "integer"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "granted_at": {
            "format": "date-time",
            "title": "Granted At",
            "type": "string"
          },
          "granted_by": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Granted By"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "revoked_by": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked By"
          },
          "time_remaining_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Time Remaining Seconds"
          }
        },
        "required": [
          "id",
          "instance_id",
          "granted_by",
          "granted_at",
          "expires_at",
          "revoked_at",
          "revoked_by",
          "reason",
          "duration_hours",
          "is_active",
          "time_remaining_seconds"
        ],
        "title": "GrantOut",
        "type": "object"
      },
      "src__api__instances__ChatRequest": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9:_-]{1,128}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "message": {
            "maxLength": 8000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "ChatRequest",
        "type": "object"
      },
      "src__api__instances__InstanceUsageOut": {
        "description": "Usage metrics for a single instance.",
        "properties": {
          "daily": {
            "items": {
              "type": "object"
            },
            "title": "Daily",
            "type": "array"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "total_cost_usd": {
            "title": "Total Cost Usd",
            "type": "string"
          },
          "total_requests": {
            "title": "Total Requests",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "unique_end_users": {
            "title": "Unique End Users",
            "type": "integer"
          }
        },
        "required": [
          "instance_id",
          "hostname",
          "total_requests",
          "total_tokens",
          "total_cost_usd",
          "unique_end_users",
          "daily"
        ],
        "title": "InstanceUsageOut",
        "type": "object"
      },
      "src__api__marketplace__SkillOut": {
        "properties": {
          "avg_rating": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Rating"
          },
          "billing_type": {
            "title": "Billing Type",
            "type": "string"
          },
          "category": {
            "title": "Category",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current_version": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkillVersionOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "emoji": {
            "title": "Emoji",
            "type": "string"
          },
          "featured": {
            "title": "Featured",
            "type": "boolean"
          },
          "haldir_verified": {
            "default": false,
            "title": "Haldir Verified",
            "type": "boolean"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "install_count": {
            "title": "Install Count",
            "type": "integer"
          },
          "item_type": {
            "default": "skill",
            "title": "Item Type",
            "type": "string"
          },
          "long_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Description"
          },
          "mcp_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Config"
          },
          "min_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Tier"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "publisher_id": {
            "format": "uuid",
            "title": "Publisher Id",
            "type": "string"
          },
          "publisher_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publisher Name"
          },
          "publisher_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publisher Slug"
          },
          "screenshots": {
            "items": {
              "type": "string"
            },
            "title": "Screenshots",
            "type": "array"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "source_type": {
            "title": "Source Type",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "publisher_id",
          "slug",
          "name",
          "emoji",
          "category",
          "price_cents",
          "billing_type",
          "status",
          "featured",
          "install_count",
          "source_type",
          "created_at",
          "updated_at"
        ],
        "title": "SkillOut",
        "type": "object"
      },
      "src__api__metrics__InstanceUsageOut": {
        "description": "Instance-level usage breakdown.\n\n\"Get to the chopper!\" \u2014 Dutch, Predator\n(about getting to the right instance)",
        "properties": {
          "instances": {
            "items": {
              "$ref": "#/components/schemas/InstanceUsageRow"
            },
            "title": "Instances",
            "type": "array"
          },
          "total_count": {
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "instances",
          "total_count"
        ],
        "title": "InstanceUsageOut",
        "type": "object"
      },
      "src__api__pin_confirmation__IdentityLookupOut": {
        "description": "Response for internal identity lookup \u2014 mirrors customer_identities.IdentityLookupOut.",
        "properties": {
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "customer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Email"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "identity_id": {
            "format": "uuid",
            "title": "Identity Id",
            "type": "string"
          },
          "role_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role Override"
          },
          "verified": {
            "title": "Verified",
            "type": "boolean"
          }
        },
        "required": [
          "customer_id",
          "identity_id",
          "verified",
          "channel",
          "external_id"
        ],
        "title": "IdentityLookupOut",
        "type": "object"
      },
      "src__api__plugins__ProviderOut": {
        "properties": {
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug"
        ],
        "title": "ProviderOut",
        "type": "object"
      },
      "src__api__providers__ProviderOut": {
        "properties": {
          "auth_type": {
            "title": "Auth Type",
            "type": "string"
          },
          "base_url": {
            "title": "Base Url",
            "type": "string"
          },
          "docs_url": {
            "title": "Docs Url",
            "type": "string"
          },
          "has_key": {
            "default": false,
            "title": "Has Key",
            "type": "boolean"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "key_env_hint": {
            "title": "Key Env Hint",
            "type": "string"
          },
          "model_count": {
            "title": "Model Count",
            "type": "integer"
          },
          "models": {
            "items": {
              "$ref": "#/components/schemas/ModelOut"
            },
            "title": "Models",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rate_limit_note": {
            "title": "Rate Limit Note",
            "type": "string"
          },
          "supports_streaming": {
            "title": "Supports Streaming",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "auth_type",
          "base_url",
          "key_env_hint",
          "docs_url",
          "models",
          "supports_streaming",
          "rate_limit_note",
          "model_count"
        ],
        "title": "ProviderOut",
        "type": "object"
      },
      "src__api__provision_api__ProvisionRequest": {
        "description": "Self-provisioning request from a PaaS customer's application.\n\n\"I need your clothes, your boots, and your motorcycle.\" \u2014 T-800\n(about what we need to provision an instance)",
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable name for the instance",
            "title": "Display Name"
          },
          "end_user_id": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional end-user identifier for tracking",
            "title": "End User Id"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Idempotency key to prevent duplicate provisions",
            "title": "Idempotency Key"
          },
          "preset_id": {
            "description": "Template preset ID (e.g. 'personal_assistant')",
            "title": "Preset Id",
            "type": "string"
          },
          "region_id": {
            "description": "Target region (e.g. 'eu-central')",
            "title": "Region Id",
            "type": "string"
          },
          "tier_id": {
            "description": "Product tier UUID",
            "title": "Tier Id",
            "type": "string"
          }
        },
        "required": [
          "preset_id",
          "region_id",
          "tier_id"
        ],
        "title": "ProvisionRequest",
        "type": "object"
      },
      "src__api__provision_api__ProvisionResponse": {
        "description": "Provisioning result.",
        "properties": {
          "idempotency_key": {
            "title": "Idempotency Key",
            "type": "string"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "task_id",
          "idempotency_key",
          "status",
          "message"
        ],
        "title": "ProvisionResponse",
        "type": "object"
      },
      "src__api__recipes__DeployRequest": {
        "properties": {
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "hosting_mode": {
            "default": "dedicated",
            "pattern": "^(dedicated|shared)$",
            "title": "Hosting Mode",
            "type": "string"
          },
          "hostname": {
            "maxLength": 100,
            "title": "Hostname",
            "type": "string"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          },
          "instance_overrides": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Overrides"
          },
          "manifest_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manifest Id"
          },
          "recipe_id": {
            "format": "uuid",
            "title": "Recipe Id",
            "type": "string"
          },
          "region_id": {
            "maxLength": 50,
            "title": "Region Id",
            "type": "string"
          },
          "shared_node_capacity": {
            "default": 50,
            "maximum": 200.0,
            "minimum": 10.0,
            "title": "Shared Node Capacity",
            "type": "integer"
          },
          "tier_id": {
            "format": "uuid",
            "title": "Tier Id",
            "type": "string"
          }
        },
        "required": [
          "recipe_id",
          "customer_id",
          "tier_id",
          "region_id",
          "hostname"
        ],
        "title": "DeployRequest",
        "type": "object"
      },
      "src__api__recipes__DeployResponse": {
        "properties": {
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "missing_connections": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Missing Connections",
            "type": "array"
          },
          "ready": {
            "title": "Ready",
            "type": "boolean"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          },
          "template_name": {
            "title": "Template Name",
            "type": "string"
          },
          "violations": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Violations",
            "type": "array"
          }
        },
        "required": [
          "template_name",
          "ready"
        ],
        "title": "DeployResponse",
        "type": "object"
      },
      "src__api__rule_templates__TemplateCreate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/RuleDefinition"
            },
            "title": "Rules",
            "type": "array"
          }
        },
        "required": [
          "name",
          "rules"
        ],
        "title": "TemplateCreate",
        "type": "object"
      },
      "src__api__rule_templates__TemplateOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rules": {
            "items": {
              "type": "object"
            },
            "title": "Rules",
            "type": "array"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "description",
          "rules",
          "version",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "TemplateOut",
        "type": "object"
      },
      "src__api__rule_templates__TemplateUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "rules": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RuleDefinition"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rules"
          }
        },
        "title": "TemplateUpdate",
        "type": "object"
      },
      "src__api__runtime_images__RegisterRequest": {
        "properties": {
          "built_at": {
            "format": "date-time",
            "title": "Built At",
            "type": "string"
          },
          "bundle_hash": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Hash"
          },
          "compatibility_hash": {
            "maxLength": 80,
            "minLength": 10,
            "title": "Compatibility Hash",
            "type": "string"
          },
          "manifest_id": {
            "maxLength": 100,
            "title": "Manifest Id",
            "type": "string"
          },
          "provider": {
            "maxLength": 50,
            "title": "Provider",
            "type": "string"
          },
          "registered_by": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registered By"
          },
          "runtime_version": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime Version"
          },
          "snapshot_id": {
            "maxLength": 255,
            "title": "Snapshot Id",
            "type": "string"
          }
        },
        "required": [
          "manifest_id",
          "provider",
          "snapshot_id",
          "compatibility_hash",
          "built_at"
        ],
        "title": "RegisterRequest",
        "type": "object"
      },
      "src__api__smoke__ChatRequest": {
        "properties": {
          "message": {
            "maxLength": 4000,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "ChatRequest",
        "type": "object"
      },
      "src__api__smoke__ProvisionRequest": {
        "properties": {
          "agent_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "idempotency_key": {
            "maxLength": 255,
            "title": "Idempotency Key",
            "type": "string"
          },
          "manifest_id": {
            "maxLength": 100,
            "title": "Manifest Id",
            "type": "string"
          },
          "region_id": {
            "maxLength": 80,
            "title": "Region Id",
            "type": "string"
          },
          "tier_id": {
            "maxLength": 80,
            "title": "Tier Id",
            "type": "string"
          }
        },
        "required": [
          "manifest_id",
          "region_id",
          "tier_id",
          "idempotency_key"
        ],
        "title": "ProvisionRequest",
        "type": "object"
      },
      "src__api__smoke__ProvisionResponse": {
        "properties": {
          "idempotency_key": {
            "title": "Idempotency Key",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "idempotency_key"
        ],
        "title": "ProvisionResponse",
        "type": "object"
      },
      "src__api__websites__DeployRequest": {
        "description": "Request to deploy website to an instance.\n\ninstance_id is optional \u2014 if provided, deploys the config linked to that\ninstance. If omitted, picks the most recent unlinked draft config.\n\"Get to the chopper!\" \u2014 Dutch, Predator (about deploying to VPS)",
        "properties": {
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "preset_id": {
            "default": "support_agent",
            "title": "Preset Id",
            "type": "string"
          },
          "region_id": {
            "title": "Region Id",
            "type": "string"
          },
          "tier_id": {
            "title": "Tier Id",
            "type": "string"
          }
        },
        "required": [
          "tier_id",
          "region_id"
        ],
        "title": "DeployRequest",
        "type": "object"
      },
      "src__api__websites__DeployResponse": {
        "description": "Response after initiating website deployment.",
        "properties": {
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "website_config_id": {
            "format": "uuid",
            "title": "Website Config Id",
            "type": "string"
          }
        },
        "required": [
          "website_config_id",
          "status",
          "message"
        ],
        "title": "DeployResponse",
        "type": "object"
      },
      "src__api__websites__TemplateOut": {
        "description": "Website template from the platform catalog.",
        "properties": {
          "custom_upload_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Upload Id"
          },
          "default_content": {
            "default": {},
            "title": "Default Content",
            "type": "object"
          },
          "default_integrations": {
            "default": [],
            "items": {},
            "title": "Default Integrations",
            "type": "array"
          },
          "default_seo_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Seo Description"
          },
          "default_seo_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Seo Title"
          },
          "default_skills": {
            "default": [],
            "items": {},
            "title": "Default Skills",
            "type": "array"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "preview_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Image Url"
          },
          "preview_urls": {
            "default": [],
            "items": {},
            "title": "Preview Urls",
            "type": "array"
          },
          "rendering_mode": {
            "title": "Rendering Mode",
            "type": "string"
          },
          "scope": {
            "default": "platform",
            "title": "Scope",
            "type": "string"
          },
          "security_status": {
            "default": "clean",
            "title": "Security Status",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "source_type": {
            "default": "builtin",
            "title": "Source Type",
            "type": "string"
          },
          "status": {
            "default": "active",
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "vertical": {
            "title": "Vertical",
            "type": "string"
          },
          "visibility": {
            "default": "customer",
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "vertical",
          "rendering_mode",
          "display_order"
        ],
        "title": "TemplateOut",
        "type": "object"
      },
      "src__api__whatsapp_templates__TemplateCreate": {
        "properties": {
          "body_text": {
            "description": "Template body with {{1}}, {{2}} placeholders",
            "title": "Body Text",
            "type": "string"
          },
          "buttons": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buttons"
          },
          "category": {
            "description": "One of: ('utility', 'marketing', 'authentication')",
            "title": "Category",
            "type": "string"
          },
          "footer_text": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Footer Text"
          },
          "header_text": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Text"
          },
          "language": {
            "default": "en_US",
            "maxLength": 10,
            "title": "Language",
            "type": "string"
          },
          "name": {
            "description": "Template name (lowercase, underscores)",
            "maxLength": 512,
            "title": "Name",
            "type": "string"
          },
          "sample_values": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sample values for placeholders during Meta review",
            "title": "Sample Values"
          }
        },
        "required": [
          "name",
          "category",
          "body_text"
        ],
        "title": "TemplateCreate",
        "type": "object"
      },
      "src__api__whatsapp_templates__TemplateOut": {
        "properties": {
          "approved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved At"
          },
          "body_text": {
            "title": "Body Text",
            "type": "string"
          },
          "buttons": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buttons"
          },
          "category": {
            "title": "Category",
            "type": "string"
          },
          "channel_endpoint_id": {
            "format": "uuid",
            "title": "Channel Endpoint Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "footer_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Footer Text"
          },
          "header_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Text"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "language": {
            "title": "Language",
            "type": "string"
          },
          "meta_template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Meta Template Id"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rejection_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rejection Reason"
          },
          "sample_values": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Values"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "submitted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted At"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "channel_endpoint_id",
          "name",
          "language",
          "category",
          "status",
          "body_text",
          "created_at",
          "updated_at"
        ],
        "title": "TemplateOut",
        "type": "object"
      },
      "src__api__whatsapp_templates__TemplateUpdate": {
        "properties": {
          "body_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Text"
          },
          "buttons": {
            "anyOf": [
              {
                "items": {
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buttons"
          },
          "footer_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Footer Text"
          },
          "header_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Text"
          },
          "sample_values": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Values"
          }
        },
        "title": "TemplateUpdate",
        "type": "object"
      },
      "src__api__workflow_files__WorkflowCreate": {
        "properties": {
          "content": {
            "description": "Full workflow content (YAML frontmatter + Markdown body)",
            "title": "Content",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 200,
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "maxLength": 100,
            "pattern": "^[a-z0-9][a-z0-9_-]*$",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name",
          "content"
        ],
        "title": "WorkflowCreate",
        "type": "object"
      },
      "src__api__workflow_files__WorkflowOut": {
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "content_hash": {
            "title": "Content Hash",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "frontmatter": {
            "title": "Frontmatter",
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "signed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed At"
          },
          "signed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed By"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "superseded_by": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded By"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "slug",
          "name",
          "description",
          "version",
          "content_hash",
          "frontmatter",
          "status",
          "signed_by",
          "signed_at",
          "superseded_by",
          "created_at",
          "updated_at"
        ],
        "title": "WorkflowOut",
        "type": "object"
      },
      "src__api__workflows__WorkflowCreate": {
        "properties": {
          "assigned_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned To"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "next_action_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Action At"
          },
          "reference": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "External reference (property ref, job ref, etc.)",
            "title": "Reference"
          },
          "stage": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Initial stage",
            "title": "Stage"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "workflow_state": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow State"
          },
          "workflow_type": {
            "description": "One of: ('lead', 'rent_arrears', 'maintenance', 'compliance_renewal', 'viewing', 'roster', 'approval', 'invoice_chase', 'onboarding', 'custom')",
            "title": "Workflow Type",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "workflow_type"
        ],
        "title": "WorkflowCreate",
        "type": "object"
      },
      "src__api__workflows__WorkflowOut": {
        "properties": {
          "approver_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approver Id"
          },
          "assigned_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned To"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "escalation_level": {
            "title": "Escalation Level",
            "type": "integer"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "history": {
            "default": [],
            "items": {},
            "title": "History",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "instance_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Id"
          },
          "last_action_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Action At"
          },
          "next_action_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Action At"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "workflow_state": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow State"
          },
          "workflow_type": {
            "title": "Workflow Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "customer_id",
          "workflow_type",
          "status",
          "escalation_level",
          "created_at",
          "updated_at"
        ],
        "title": "WorkflowOut",
        "type": "object"
      },
      "src__auth__endpoints__RegisterRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "password": {
            "maxLength": 128,
            "minLength": 8,
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "title": "RegisterRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "HydraCore",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/auth/forgot-password": {
      "post": {
        "description": "Request a password reset link via email.\n\nAlways returns success to prevent email enumeration.\n\"I could tell you, but then I'd have to kill you.\" - Top Gun",
        "operationId": "forgot_password_auth_forgot_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Forgot Password Auth Forgot Password Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forgot Password",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/github": {
      "get": {
        "description": "Redirect to GitHub OAuth authorization.\n\"With great power comes great responsibility.\" - Uncle Ben\n(about granting OAuth scopes)",
        "operationId": "github_login_auth_github_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Github Login",
        "tags": [
          "oauth"
        ]
      }
    },
    "/auth/github/callback": {
      "get": {
        "description": "Handle GitHub OAuth callback.",
        "operationId": "github_callback_auth_github_callback_get",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Error"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Github Callback",
        "tags": [
          "oauth"
        ]
      }
    },
    "/auth/google": {
      "get": {
        "description": "Redirect to Google OAuth consent screen.\n\"I feel the need... the need for speed.\" - Maverick, Top Gun\n(and also the need for Google authentication)",
        "operationId": "google_login_auth_google_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Google Login",
        "tags": [
          "oauth"
        ]
      }
    },
    "/auth/google/callback": {
      "get": {
        "description": "Handle Google OAuth callback.",
        "operationId": "google_callback_auth_google_callback_get",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Error"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Google Callback",
        "tags": [
          "oauth"
        ]
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "login_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "logout_auth_logout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Logout",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/me": {
      "get": {
        "description": "Return user metadata from cookie-authenticated session.",
        "operationId": "auth_me_auth_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Auth Me Auth Me Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Auth Me",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/refresh": {
      "post": {
        "operationId": "refresh_tokens_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh Tokens",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/register": {
      "post": {
        "operationId": "register_auth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__auth__endpoints__RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/resend-verification": {
      "post": {
        "description": "Resend verification code. Rate limited to prevent abuse.\n\"I could tell you, but then I'd have to kill you.\" - Top Gun",
        "operationId": "resend_verification_auth_resend_verification_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Resend Verification Auth Resend Verification Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resend Verification",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/reset-password": {
      "post": {
        "description": "Reset password using a token from the forgot-password email.\n\nToken is single-use and expires after 30 minutes.\n\"Hasta la vista, baby.\" - T-800 (to your old password)",
        "operationId": "reset_password_auth_reset_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Reset Password Auth Reset Password Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reset Password",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/token": {
      "post": {
        "description": "Programmatic token endpoint \u2014 Basic auth (email:password), returns body tokens, NEVER sets cookies.\n\nFor CLI/SDK usage only.",
        "operationId": "programmatic_token_auth_token_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Programmatic Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/verify-email": {
      "post": {
        "description": "Verify email with 6-digit code sent via Resend.\n\nReturns fresh JWT tokens so the frontend immediately has evf:true.\nWithout this, the old JWT still has evf:false and every\nget_current_user-protected endpoint returns 403.\n\n\"The name's Bond. James Bond.\" - but with a verification code.",
        "operationId": "verify_email_auth_verify_email_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Verify Email Auth Verify Email Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Email",
        "tags": [
          "auth"
        ]
      }
    },
    "/health": {
      "get": {
        "description": "Liveness + dependency health.\n\nReturns 200 with `{\"status\":\"ok\", ...}` when every dependency\nresponds within the timeout budget. Returns 503 with\n`{\"status\":\"degraded\", ...}` otherwise; the per-dependency\nstatus field surfaces which one(s).\n\nSets `Cache-Control: no-store` so no upstream serves a cached\nresponse.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Health Health Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health"
      }
    },
    "/hooks/sms/{instance_id}": {
      "post": {
        "description": "Receive inbound SMS from Twilio. Returns TwiML response.\n\nUnlike WhatsApp (shared webhook URL), SMS uses per-instance webhook URLs\nbecause Twilio associates webhook URLs per phone number, and we map\nphone numbers 1:1 to instances via channel_endpoints.",
        "operationId": "sms_webhook_inbound_hooks_sms__instance_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Sms Webhook Inbound Hooks Sms  Instance Id  Post",
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sms Webhook Inbound",
        "tags": [
          "sms-webhook"
        ]
      }
    },
    "/hooks/telegram/{instance_id}": {
      "post": {
        "description": "Receive a Telegram webhook update and forward to the agent instance.\n\nThis endpoint is PUBLIC \u2014 Telegram's servers call it. Authentication\nis via the X-Telegram-Bot-Api-Secret-Token header, which we set when\nregistering the webhook and verify here.\n\n\"I have a very particular set of skills.\" \u2014 Bryan Mills, Taken\n(about verifying webhook secrets)",
        "operationId": "receive_telegram_webhook_hooks_telegram__instance_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "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 Telegram Webhook",
        "tags": [
          "telegram-webhook"
        ]
      }
    },
    "/hooks/voice/{instance_id}": {
      "post": {
        "description": "Receive voice call events from the provider.\n\nEvents: call_started, call_ended, call_analyzed, transcript_update.\nFlow:\n1. Resolve instance \u2192 tenant_id, set RLS context\n2. Verify webhook signature\n3. Look up channel endpoint for this instance\n4. Parse event using the registered provider adapter\n5. Handle event (track call, create workflow record on end, etc.)",
        "operationId": "voice_webhook_inbound_hooks_voice__instance_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Voice Webhook Inbound Hooks Voice  Instance Id  Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Voice Webhook Inbound",
        "tags": [
          "voice-webhook"
        ]
      }
    },
    "/hooks/voice/{instance_id}/twiml": {
      "post": {
        "description": "Return TwiML for Pipecat-based voice \u2014 connects Twilio to voice agent WS.\n\nTwilio calls this URL when a call arrives on the configured phone number.\nWe return TwiML that streams the call audio to the voice agent WebSocket\nrunning on the VPS.",
        "operationId": "voice_twiml_inbound_hooks_voice__instance_id__twiml_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Voice Twiml Inbound",
        "tags": [
          "voice-webhook"
        ]
      }
    },
    "/hooks/whatsapp": {
      "get": {
        "description": "Meta webhook verification (GET). Returns challenge if verify_token matches.\n\nMeta sends this when you register the webhook URL. We look up the\nverify_token across all WhatsApp channel_endpoints to find a match.",
        "operationId": "whatsapp_webhook_verify_hooks_whatsapp_get",
        "parameters": [
          {
            "in": "query",
            "name": "hub.mode",
            "required": false,
            "schema": {
              "title": "Hub.Mode",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "hub.verify_token",
            "required": false,
            "schema": {
              "title": "Hub.Verify Token",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "hub.challenge",
            "required": false,
            "schema": {
              "title": "Hub.Challenge",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Whatsapp Webhook Verify",
        "tags": [
          "whatsapp-webhook"
        ]
      },
      "post": {
        "description": "Receive inbound WhatsApp messages from Meta.\n\nFlow:\n1. Verify signature (X-Hub-Signature-256)\n2. Parse message\n3. Route via channel_endpoints (phone_number_id \u2192 instance)\n4. Forward to agent runtime over WireGuard\n5. Return 200 immediately (async processing)",
        "operationId": "whatsapp_webhook_inbound_hooks_whatsapp_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Whatsapp Webhook Inbound Hooks Whatsapp Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Whatsapp Webhook Inbound",
        "tags": [
          "whatsapp-webhook"
        ]
      }
    },
    "/internal/bootstrap/artifacts/{instance_id}": {
      "get": {
        "description": "Stream encrypted artifact bundle.\n\nRequires:\n- mTLS client cert matching instance\n- X-Download-Token header (from /secrets)\n\nDownload token allows 3 attempts, consumed on successful transfer.\n\nArgs:\n    instance_id: Instance UUID\n    request: FastAPI request (for mTLS cert extraction)\n    db: Database session\n    x_download_token: Download token from /secrets (64 hex chars)\n\nReturns:\n    StreamingResponse with encrypted bundle (application/octet-stream)\n\nErrors:\n    401: Invalid mTLS cert or download token\n    404: Instance or artifact not found\n    429: Too many download attempts",
        "operationId": "download_artifact_internal_bootstrap_artifacts__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-download-token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Download-Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Artifact",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/bootstrap/artifacts/{instance_id}/website": {
      "get": {
        "description": "Download website bundle for an instance (unencrypted static assets).\n\nSame auth as agent artifact: mTLS cert + download token.\nReturns the website tarball from R2 if one was provisioned.\nNo-op 404 if no website was deployed with this instance.\n\n\"It's just a flesh wound.\" \u2014 The Black Knight, Monty Python\n(websites are optional \u2014 no wound if missing)",
        "operationId": "download_website_bundle_internal_bootstrap_artifacts__instance_id__website_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-download-token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Download-Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Website Bundle",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/bootstrap/callback": {
      "post": {
        "description": "Receive bootstrap callback from agent.\n\nValidates callback JWT and enforces strict monotonic sequence.\nSequence: installing(1) \u2192 configuring(2) \u2192 securing(3) \u2192 ready(4)\nError can occur at seq 2 or 3 only.\n\nArgs:\n    request: Stage + seq + optional message\n    db: Database session\n    authorization: Bearer {callback_jwt}\n\nReturns:\n    status: \"ok\"\n    message: Confirmation message\n\nErrors:\n    401: Invalid or expired JWT\n    400: Invalid stage/seq or sequence violation\n    404: Instance or callback state not found",
        "operationId": "receive_callback_internal_bootstrap_callback_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallbackRequest"
              }
            }
          },
          "required": true
        },
        "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": "Receive Callback",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/bootstrap/cert": {
      "post": {
        "description": "Issue mTLS certificate from bootstrap token and CSR.\n\nTwo-step bootstrap: This is step 1 (bootstrap token \u2192 mTLS cert).\nStep 2 is /secrets (mTLS \u2192 secrets + callback JWT).\n\nNOTE: Bootstrap token is NOT consumed here (consumed in /secrets after mTLS).\n\nArgs:\n    request: Bootstrap token + CSR PEM\n    db: Database session\n\nReturns:\n    cert_pem: PEM-encoded mTLS certificate\n    session_id: Bootstrap session UUID for /secrets call\n\nErrors:\n    401: Invalid, expired, or consumed token\n    400: Invalid CSR\n    500: CA error",
        "operationId": "issue_certificate_internal_bootstrap_cert_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Issue Certificate",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/bootstrap/diagnostic": {
      "post": {
        "description": "Free-form trace breadcrumbs from bootstrap-agent.sh.\n\nSame JWT auth as /callback (the callback_jwt issued at /secrets\nis reused). No monotonic-sequence enforcement \u2014 every accepted\nrequest appends a row to provision_logs with the given label as\n`stage` and the message body as `message`. Designed for shipping\n\"where am I\" traces during fault diagnosis without disturbing\nthe production callback state machine.\n\nWhy a separate endpoint:\n  The strict /callback handler rejects out-of-sequence stage+\n  seq combos with 400, which the shell helper's `|| true`\n  silently swallows \u2014 so trace breadcrumbs aimed at /callback\n  never reached provision_logs. This endpoint accepts anything\n  JWT-valid + label + message.",
        "operationId": "receive_diagnostic_internal_bootstrap_diagnostic_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiagnosticRequest"
              }
            }
          },
          "required": true
        },
        "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": "Receive Diagnostic",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/bootstrap/early-diagnostic": {
      "post": {
        "description": "Pre-mTLS bootstrap trace logging.\n\nThe strict /callback endpoint and the JWT-protected /diagnostic\nendpoint both require artefacts that bootstrap-agent.sh only has\nAFTER Phase 1 (cert exchange) + Phase 2 (secrets fetch + JWT).\nWhen bootstrap hangs in Phase 0/1/2 we get nothing back.\n\nThis endpoint authenticates against the instance's bootstrap_token\n(a one-shot per-instance secret already known to the script from\ncloud-init Jinja templating). Token is hashed and compared in\nconstant time against the stored bootstrap_tokens row; we do NOT\nconsume it (consumption stays bound to /secrets).\n\nWrites the message to provision_logs. Same effect as\n/diagnostic but available before mTLS is up.",
        "operationId": "receive_early_diagnostic_internal_bootstrap_early_diagnostic_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarlyDiagnosticRequest"
              }
            }
          },
          "required": true
        },
        "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": "Receive Early Diagnostic",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/bootstrap/secrets": {
      "post": {
        "description": "Provide decryption secrets after mTLS verification.\n\nTwo-step bootstrap: This is step 2 (mTLS \u2192 secrets + callback JWT).\nRequires client cert from step 1 (/cert).\n\nBootstrap token is consumed HERE (after mTLS verification succeeds).\nCallback JWT is created here.\nDownload token is created here (one-time use, cannot retry /secrets).\n\nArgs:\n    request_body: Session ID from /cert\n    request: FastAPI request (for mTLS cert extraction)\n    db: Database session\n\nReturns:\n    callback_jwt: JWT for /callback endpoint\n    artifact_download_token: Token for /artifacts (raw hex)\n    decryption_key_hex: Bundle decryption key (64 hex chars)\n    artifact_cipher_hash: Expected ciphertext hash (sha256:...)\n    bundle_plain_hash: Expected plaintext hash (sha256:...)\n    agent_config: Agent configuration (non-secret)\n    agent_secrets: Agent secrets (API keys, etc.)\n\nErrors:\n    401: Invalid mTLS cert or session\n    404: Session not found\n    410: Session expired or already complete",
        "operationId": "get_secrets_internal_bootstrap_secrets_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Secrets",
        "tags": [
          "bootstrap"
        ]
      }
    },
    "/internal/edge/health": {
      "get": {
        "description": "Proxy the edge-sync agent's health endpoint over WireGuard.\n\nReturns the edge agent's self-reported sync state: last successful\nsync, consecutive failures, sync lag, domain count, Caddy reloads.\n\nForwards the edge agent's HTTP status code:\n  200 \u2014 edge healthy (last sync within 3\u00d7 poll interval)\n  503 \u2014 edge degraded, unreachable, timed out, or errored\n\n\"Houston, we have a problem.\" \u2014 Jack Swigert, Apollo 13\n(about edge proxies that stop syncing)",
        "operationId": "get_edge_health_internal_edge_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Edge Health",
        "tags": [
          "edge-routes"
        ]
      }
    },
    "/internal/edge/routes": {
      "get": {
        "description": "Return the full domain \u2192 VPS route table for the edge proxy.\n\nQuery logic:\n1. Find all TenantBranding rows with a verified custom_domain\n   AND edge_instance_id pinned (domain_verified=True AND\n   custom_domain IS NOT NULL AND edge_instance_id IS NOT NULL)\n2. Join to that specific instance (must be running + have VPN IP)\n3. Build route entries \u2014 one domain, one instance, no spraying\n\n\"One ring to rule them all, one ring to find them.\" \u2014 Gandalf\n(about one domain routing to exactly one instance, not all of them)",
        "operationId": "get_edge_routes_internal_edge_routes_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutesResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Edge Routes",
        "tags": [
          "edge-routes"
        ]
      }
    },
    "/internal/v1/admin/tenants/{tenant_id}/teardown": {
      "post": {
        "description": "`POST /internal/v1/admin/tenants/{tenant_id}/teardown`\n\nTear down a tenant + its instances + cross-DB rows.\n\n- **Auth**: ops bearer token (`verify_ops_bearer_token`).\n- **Body**: `{\"confirmation_phrase\": \"DELETE TENANT <slug>\"}` \u2014\n  mismatch \u2192 400.\n- **404**: tenant not found.\n- **500**: FK violation or unexpected DB failure on the final\n  tenant DELETE.\n- **200**: teardown summary (instances terminated, rows per\n  table, warnings).\n\nThe actual cascade lives in `src.services.tenant_teardown.\nteardown_tenant`. Reaper (\u2620\ufe0f.4) calls the helper directly,\nbypassing this HTTP layer.",
        "operationId": "teardown_tenant_endpoint_internal_v1_admin_tenants__tenant_id__teardown_post",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantTeardownRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantTeardownResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Teardown Tenant Endpoint",
        "tags": [
          "admin-tenant-lifecycle"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/approvals/pending": {
      "get": {
        "description": "List pending approvals for a customer.",
        "operationId": "list_pending_approvals_internal_v1_instances__instance_id__approvals_pending_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pending Approvals",
        "tags": [
          "approvals"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/approvals/request": {
      "post": {
        "description": "Create a pending approval. Called when a rule triggers require_approval.",
        "operationId": "create_approval_request_internal_v1_instances__instance_id__approvals_request_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Approval Request",
        "tags": [
          "approvals"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/approvals/resolve": {
      "post": {
        "description": "Resolve a pending approval (approve or reject). Creates outbox entry on approve.",
        "operationId": "resolve_approval_internal_v1_instances__instance_id__approvals_resolve_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalResolve"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Approval",
        "tags": [
          "approvals"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/audit-events": {
      "post": {
        "operationId": "ingest_runtime_audit_events_internal_v1_instances__instance_id__audit_events_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeAuditBatchIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeAuditResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ingest Runtime Audit Events",
        "tags": [
          "runtime-audit"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/calendar/deeplink": {
      "post": {
        "description": "Generate a Google Calendar deep link URL for one-tap add.\n\nThis does NOT use the Calendar API \u2014 it generates a URL that\nanyone can click to add the event to their personal calendar.\nZero friction for workers (Dave taps the link \u2192 event in his phone).\nAuth: Bearer proxy key.",
        "operationId": "generate_deep_link_internal_v1_instances__instance_id__calendar_deeplink_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarEventCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepLinkOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Generate Deep Link",
        "tags": [
          "google-calendar"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/calendar/events": {
      "get": {
        "description": "List calendar events. Auth: Bearer proxy key.",
        "operationId": "list_calendar_events_internal_v1_instances__instance_id__calendar_events_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "calendar_id",
            "required": false,
            "schema": {
              "default": "primary",
              "title": "Calendar Id",
              "type": "string"
            }
          },
          {
            "description": "Specific calendar connection name (for multi-calendar)",
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific calendar connection name (for multi-calendar)",
              "title": "Connection Name"
            }
          },
          {
            "description": "Start of time range (default: now)",
            "in": "query",
            "name": "time_min",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start of time range (default: now)",
              "title": "Time Min"
            }
          },
          {
            "description": "End of time range (default: now + 7 days)",
            "in": "query",
            "name": "time_max",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End of time range (default: now + 7 days)",
              "title": "Time Max"
            }
          },
          {
            "in": "query",
            "name": "max_results",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Max Results",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEventListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Calendar Events",
        "tags": [
          "google-calendar"
        ]
      },
      "post": {
        "description": "Create a calendar event. Auth: Bearer proxy key. Requires write_events capability.",
        "operationId": "create_calendar_event_internal_v1_instances__instance_id__calendar_events_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarEventCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEventOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Calendar Event",
        "tags": [
          "google-calendar"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/calendar/freebusy": {
      "get": {
        "description": "Check free/busy status. Auth: Bearer proxy key. Requires read_freebusy capability.",
        "operationId": "check_freebusy_internal_v1_instances__instance_id__calendar_freebusy_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "calendar_id",
            "required": false,
            "schema": {
              "default": "primary",
              "title": "Calendar Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          },
          {
            "in": "query",
            "name": "time_min",
            "required": true,
            "schema": {
              "format": "date-time",
              "title": "Time Min",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "time_max",
            "required": true,
            "schema": {
              "format": "date-time",
              "title": "Time Max",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeBusyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check Freebusy",
        "tags": [
          "google-calendar"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/cert/renew": {
      "post": {
        "description": "Renew mTLS certificate for running instance.\n\nRequires:\n- Current valid mTLS cert\n- WireGuard public key verification\n- Instance status = 'running'\n- Rate limit: 1 renewal per hour per instance\n\nCertificate lifecycle:\n1. Verify current cert is valid and not revoked\n2. Check rate limit (last renewal < 1 hour ago)\n3. Issue new 24-hour cert from CSR\n4. Record new cert in InternalCertInventory\n5. Revoke old cert (set revoked_at)\n\nArgs:\n    instance_id: Instance UUID\n    request_body: CSR PEM + WG public key\n    request: FastAPI request (for mTLS cert extraction)\n    db: Database session\n\nReturns:\n    cert_pem: New PEM-encoded mTLS certificate\n    cert_serial: New certificate serial number\n    expires_at: Expiry timestamp (ISO 8601)\n\nErrors:\n    401: Invalid mTLS cert or identity verification failed\n    404: Instance not found\n    409: Instance not running\n    429: Rate limit exceeded (1 renewal per hour)\n    400: Invalid CSR\n    500: CA error",
        "operationId": "renew_certificate_internal_v1_instances__instance_id__cert_renew_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertRenewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertRenewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Renew Certificate",
        "tags": [
          "lifecycle"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/chat/media/{media_id}": {
      "get": {
        "description": "Download chat media \u2014 runtime route (proxy-key auth).\n\nCalled by the agent runtime to fetch uploaded media for LLM vision input.",
        "operationId": "download_chat_media_internal_internal_v1_instances__instance_id__chat_media__media_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "title": "Media Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Chat Media Internal",
        "tags": [
          "chat-media"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/connections": {
      "get": {
        "description": "Runtime fetches connection credentials. Auth: Bearer proxy key.\n\nVerifies:\n1. Instance proxy-key auth\n2. Connection grant exists for this instance\n3. If capability specified, grant includes that capability\n4. Decrypts and returns credentials\n\nReturns { \"credentials\": {...}, \"capabilities\": [...] }",
        "operationId": "fetch_connection_credentials_internal_v1_instances__instance_id__connections_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "required": false,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "description": "Required capability (e.g. send_mail). If specified, 403 if grant doesn't include it.",
            "in": "query",
            "name": "capability",
            "required": false,
            "schema": {
              "description": "Required capability (e.g. send_mail). If specified, 403 if grant doesn't include it.",
              "title": "Capability",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Fetch Connection Credentials Internal V1 Instances  Instance Id  Connections Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fetch Connection Credentials",
        "tags": [
          "connections"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/credit-check": {
      "post": {
        "description": "Pre-call credit gate for VPS agents.\n\n1. Verify instance identity (mTLS)\n2. Determine server-side key_source\n3. Check tier guardrails\n4. Reserve credits (hold)\n\n\"Do you feel lucky, punk?\" \u2014 Harry Callahan\n(about credit checks)",
        "operationId": "credit_check_internal_v1_instances__instance_id__credit_check_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditCheckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Credit Check",
        "tags": [
          "credits"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/credit-release": {
      "post": {
        "description": "Release a credit hold when the LLM call failed or was cancelled.\n\nCalled by the VPS agent when all providers fail so credits aren't\nstranded until the stale hold cleanup task runs (30 min).\n\n\"Game over, man! Game over!\" \u2014 Hudson, Aliens\n(about releasing holds after provider failures)",
        "operationId": "credit_release_internal_v1_instances__instance_id__credit_release_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditReleaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditReleaseResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Credit Release",
        "tags": [
          "credits"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/customer-config": {
      "get": {
        "operationId": "get_merged_customer_config_internal_v1_instances__instance_id__customer_config_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergedConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Merged Customer Config",
        "tags": [
          "shared-hosting-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/customer-context/{customer_id}": {
      "get": {
        "description": "Resolve a customer's site context for the agent runtime.\n\nReturns the customer's primary site ID and all their sites.\nUsed by platform skills to resolve which site to operate on.",
        "operationId": "get_customer_context_internal_v1_instances__instance_id__customer_context__customer_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerContextOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Customer Context",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/drive/read/{file_id}": {
      "get": {
        "operationId": "read_drive_file_internal_v1_instances__instance_id__drive_read__file_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Drive File",
        "tags": [
          "google-drive"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/drive/search": {
      "get": {
        "operationId": "search_drive_internal_v1_instances__instance_id__drive_search_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "description": "Search by file name",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by file name",
              "title": "Query"
            }
          },
          {
            "description": "Filter by MIME type",
            "in": "query",
            "name": "mime_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by MIME type",
              "title": "Mime Type"
            }
          },
          {
            "description": "Search within folder",
            "in": "query",
            "name": "folder_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search within folder",
              "title": "Folder Id"
            }
          },
          {
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          },
          {
            "in": "query",
            "name": "max_results",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Max Results",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Drive",
        "tags": [
          "google-drive"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/email/messages": {
      "get": {
        "operationId": "list_messages_internal_internal_v1_instances__instance_id__email_messages_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Direction"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Messages Internal Internal V1 Instances  Instance Id  Email Messages Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Messages Internal",
        "tags": [
          "email-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/email/send": {
      "post": {
        "description": "Send email from an agent's inbox. Proxy-key auth.",
        "operationId": "send_email_internal_internal_v1_instances__instance_id__email_send_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Send Email Internal Internal V1 Instances  Instance Id  Email Send Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Email Internal",
        "tags": [
          "email-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/end-user-token": {
      "post": {
        "description": "Issue an end-user JWT after the agent verifies worker identity.\n\nCalled by the runtime after channel binding verification (e.g. worker\nverified via SMS/WhatsApp). Returns a short-lived JWT with person_id\nas the subject.",
        "operationId": "issue_end_user_token_internal_v1_instances__instance_id__end_user_token_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndUserTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Issue End User Token",
        "tags": [
          "end-user-portal-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-definitions": {
      "get": {
        "operationId": "internal_list_definitions_internal_v1_instances__instance_id__entity_definitions_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal List Definitions",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-definitions/{slug}": {
      "get": {
        "operationId": "internal_get_definition_internal_v1_instances__instance_id__entity_definitions__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Get Definition",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-kv": {
      "delete": {
        "operationId": "internal_kv_delete_internal_v1_instances__instance_id__entity_kv_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "namespace",
            "required": true,
            "schema": {
              "title": "Namespace",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "key",
            "required": true,
            "schema": {
              "title": "Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Kv Delete",
        "tags": [
          "entity-store"
        ]
      },
      "get": {
        "operationId": "internal_kv_get_internal_v1_instances__instance_id__entity_kv_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "namespace",
            "required": true,
            "schema": {
              "title": "Namespace",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "key",
            "required": true,
            "schema": {
              "title": "Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Kv Get",
        "tags": [
          "entity-store"
        ]
      },
      "put": {
        "operationId": "internal_kv_set_internal_v1_instances__instance_id__entity_kv_put",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KVSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Kv Set",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-kv/batch": {
      "post": {
        "operationId": "internal_kv_batch_set_internal_v1_instances__instance_id__entity_kv_batch_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KVBatchSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Kv Batch Set",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-kv/list": {
      "get": {
        "operationId": "internal_kv_list_internal_v1_instances__instance_id__entity_kv_list_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "namespace",
            "required": true,
            "schema": {
              "title": "Namespace",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Kv List",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-records": {
      "get": {
        "operationId": "internal_list_records_internal_v1_instances__instance_id__entity_records_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "definition_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Definition Slug"
            }
          },
          {
            "in": "query",
            "name": "definition_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Definition Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tag"
            }
          },
          {
            "description": "Full-text search via tsvector (indexed, requires searchable_fields on definition)",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search via tsvector (indexed, requires searchable_fields on definition)",
              "title": "Search"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal List Records",
        "tags": [
          "entity-store"
        ]
      },
      "post": {
        "operationId": "internal_create_record_internal_v1_instances__instance_id__entity_records_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Create Record",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-records/{record_id}": {
      "delete": {
        "operationId": "internal_delete_record_internal_v1_instances__instance_id__entity_records__record_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Delete Record",
        "tags": [
          "entity-store"
        ]
      },
      "get": {
        "operationId": "internal_get_record_internal_v1_instances__instance_id__entity_records__record_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Get Record",
        "tags": [
          "entity-store"
        ]
      },
      "patch": {
        "operationId": "internal_update_record_internal_v1_instances__instance_id__entity_records__record_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Update Record",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-relationships": {
      "get": {
        "operationId": "internal_list_relationships_internal_v1_instances__instance_id__entity_relationships_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "description": "Find relationships for this record",
            "in": "query",
            "name": "record_id",
            "required": true,
            "schema": {
              "description": "Find relationships for this record",
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "relationship_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Relationship Type"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "default": "both",
              "pattern": "^(from|to|both)$",
              "title": "Direction",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal List Relationships",
        "tags": [
          "entity-store"
        ]
      },
      "post": {
        "operationId": "internal_create_relationship_internal_v1_instances__instance_id__entity_relationships_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelationshipCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Create Relationship",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/entity-relationships/{relationship_id}": {
      "delete": {
        "operationId": "internal_delete_relationship_internal_v1_instances__instance_id__entity_relationships__relationship_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "relationship_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Relationship Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Delete Relationship",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/form-submissions": {
      "get": {
        "description": "List submissions for a form. Proxy-key auth.",
        "operationId": "list_form_submissions_internal_v1_instances__instance_id__form_submissions_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "form_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Form Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Form Submissions",
        "tags": [
          "platform-forms-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/gmail/send": {
      "post": {
        "description": "Send an email via Gmail API. Auth: Bearer proxy key.\n\nRequires send_mail capability on the Gmail connection.\nEmail appears in the customer's Sent folder, from their address.",
        "operationId": "send_gmail_internal_v1_instances__instance_id__gmail_send_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GmailSendRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GmailSendResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Gmail",
        "tags": [
          "google-gmail"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/identities/{identity_id}/pin": {
      "delete": {
        "description": "Remove an end-customer's self-set PIN.\n\n\"It's been revoked.\" \u2014 M, James Bond (about PIN removal)",
        "operationId": "remove_identity_pin_internal_v1_instances__instance_id__identities__identity_id__pin_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Identity Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Identity Pin",
        "tags": [
          "pin-confirmation-internal"
        ]
      },
      "post": {
        "description": "Set a PIN for an end-customer identity.\n\nCalled via the agent when an end-customer types /setpin XXXX.\nAuth: proxy key (the agent's own key for this instance).\n\n\"My PIN? It's the same as my birthday \u2014 but backwards and in Roman numerals.\"\n\u2014 Nobody, because that's terrible security advice",
        "operationId": "set_identity_pin_internal_v1_instances__instance_id__identities__identity_id__pin_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Identity Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Identity Pin",
        "tags": [
          "pin-confirmation-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/identity/resolve": {
      "get": {
        "description": "Resolve a channel identifier to a unified person.\n\nThe runtime calls this during identity resolution to check if\nthe caller has a cross-channel identity link.",
        "operationId": "resolve_unified_identity_internal_v1_instances__instance_id__identity_resolve_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": true,
            "schema": {
              "title": "Channel",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external_id",
            "required": true,
            "schema": {
              "title": "External Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Unified Identity",
        "tags": [
          "identity-unification-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/import/sheet-to-entities": {
      "post": {
        "operationId": "import_sheet_to_entities_internal_v1_instances__instance_id__import_sheet_to_entities_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SheetToEntitiesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Sheet To Entities",
        "tags": [
          "sheet-import"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/import/sheet-to-staff": {
      "post": {
        "operationId": "import_sheet_to_staff_internal_v1_instances__instance_id__import_sheet_to_staff_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SheetToStaffRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Sheet To Staff",
        "tags": [
          "sheet-import"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/invoices": {
      "get": {
        "operationId": "internal_list_invoices_internal_v1_instances__instance_id__invoices_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal List Invoices",
        "tags": [
          "finance"
        ]
      },
      "post": {
        "operationId": "internal_create_invoice_internal_v1_instances__instance_id__invoices_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Create Invoice",
        "tags": [
          "finance"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/invoices/{invoice_id}": {
      "get": {
        "operationId": "internal_get_invoice_internal_v1_instances__instance_id__invoices__invoice_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Invoice Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Get Invoice",
        "tags": [
          "finance"
        ]
      },
      "patch": {
        "operationId": "internal_update_invoice_internal_v1_instances__instance_id__invoices__invoice_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Invoice Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Update Invoice",
        "tags": [
          "finance"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/jobs": {
      "get": {
        "operationId": "list_jobs_internal_v1_instances__instance_id__jobs_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "site",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Site"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Jobs",
        "tags": [
          "jobs-shifts"
        ]
      },
      "post": {
        "description": "Create a job. Auth: Bearer proxy key.",
        "operationId": "create_job_internal_v1_instances__instance_id__jobs_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Job",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/jobs/{job_id}": {
      "patch": {
        "operationId": "update_job_internal_v1_instances__instance_id__jobs__job_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Job",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/knowledge/ingest": {
      "post": {
        "description": "Ingest text from agent runtime (e.g., after reading a Google Drive doc).",
        "operationId": "ingest_knowledge_internal_internal_v1_instances__instance_id__knowledge_ingest_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestTextRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ingest Knowledge Internal",
        "tags": [
          "knowledge-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/knowledge/query": {
      "post": {
        "description": "Semantic search over knowledge base \u2014 called by agent runtime.\n\nThe agent uses this as a function tool: \"What's the torque spec for X?\"\n\u2192 embed query \u2192 pgvector cosine similarity \u2192 return top-k chunks.",
        "operationId": "query_knowledge_internal_internal_v1_instances__instance_id__knowledge_query_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Query Knowledge Internal",
        "tags": [
          "knowledge-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/lookup/identity": {
      "get": {
        "description": "Reverse lookup: find which customer owns a given channel identity.\n\nInternal version of /v1/customers/lookup/identity \u2014 uses proxy key\nauth instead of JWT so the agent runtime can call it directly.\n\n\"Say my name.\" \u2014 Walter White, Breaking Bad\n(about identity resolution, not methamphetamine)",
        "operationId": "internal_lookup_identity_internal_v1_instances__instance_id__lookup_identity_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "description": "Channel type",
            "in": "query",
            "name": "channel",
            "required": true,
            "schema": {
              "description": "Channel type",
              "title": "Channel",
              "type": "string"
            }
          },
          {
            "description": "External ID to look up",
            "in": "query",
            "name": "external_id",
            "required": true,
            "schema": {
              "description": "External ID to look up",
              "title": "External Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__pin_confirmation__IdentityLookupOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Lookup Identity",
        "tags": [
          "pin-confirmation-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/mcp-creds/{server_slug}": {
      "post": {
        "description": "JIT fetch decrypted MCP server credentials.\n\nCalled by the agent runtime at MCP server spawn time. The runtime\npresents its proxy key for auth, and receives the decrypted\ncredential dict for the requested server slug.\n\nSecurity:\n- Proxy key auth (constant-time comparison)\n- Per-server scoping: only the requested slug's credentials returned\n- Credentials decrypted in-memory, never cached\n- Instance scope set via RLS\n\n\"I've seen things you people wouldn't believe. Attack ships on fire\noff the shoulder of Orion.\" \u2014 Roy Batty, Blade Runner\n(about what credentials get to see before they expire from memory)",
        "operationId": "fetch_mcp_credentials_internal_v1_instances__instance_id__mcp_creds__server_slug__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "server_slug",
            "required": true,
            "schema": {
              "title": "Server Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPCredentialResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fetch Mcp Credentials",
        "tags": [
          "mcp-credentials-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/onboarding/check-eligible": {
      "get": {
        "description": "Check if a worker is eligible for rostering based on onboarding status.\n\nCalled by the rostering cascade before contacting a worker.\nReturns eligible=true if no onboarding flow exists for the worker.",
        "operationId": "check_eligible_internal_v1_instances__instance_id__onboarding_check_eligible_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "person_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Person Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EligibilityResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check Eligible",
        "tags": [
          "onboarding-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/onboarding/initiate": {
      "post": {
        "operationId": "initiate_onboarding_internal_v1_instances__instance_id__onboarding_initiate_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Initiate Onboarding",
        "tags": [
          "onboarding-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/onboarding/{onboarding_id}/advance": {
      "post": {
        "description": "Advance an onboarding instance to the next stage.\n\nIdempotent: completing an already-completed stage returns current state.\nSerialised: FOR UPDATE lock prevents concurrent advances on same instance.",
        "operationId": "advance_onboarding_stage_internal_v1_instances__instance_id__onboarding__onboarding_id__advance_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "onboarding_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Onboarding Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvanceStageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Advance Onboarding Stage Internal V1 Instances  Instance Id  Onboarding  Onboarding Id  Advance Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Advance Onboarding Stage",
        "tags": [
          "onboarding-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/pin/check-required": {
      "post": {
        "description": "Check if a customer/identity has any active PINs that need verification.\n\nCalled by the agent runtime before prompting \u2014 no point asking for a PIN\nif nobody has set one.\n\n\"Are you not entertained?\" \u2014 Maximus, Gladiator (about checking PIN requirements)",
        "operationId": "check_pin_required_internal_v1_instances__instance_id__pin_check_required_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "identity_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Identity Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Check Pin Required Internal V1 Instances  Instance Id  Pin Check Required Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check Pin Required",
        "tags": [
          "pin-confirmation-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/pin/verify": {
      "post": {
        "description": "Verify a PIN for tool execution gating.\n\nCalled by the agent runtime when a PIN-protected skill is invoked.\nAuth: proxy key (the agent's own key for this instance).\n\nReturns a session token on success so the agent can cache it and\nskip re-prompting within the TTL.\n\n\"Open the pod bay doors, HAL.\" \"I'm sorry Dave, I need your PIN first.\"\n\u2014 2001: A Space Odyssey (if HAL had PIN confirmation)",
        "operationId": "verify_pin_internal_v1_instances__instance_id__pin_verify_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyPinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinVerifyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Pin",
        "tags": [
          "pin-confirmation-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/analytics": {
      "get": {
        "description": "Get analytics summary for a customer's site.",
        "operationId": "get_site_analytics_internal_v1_instances__instance_id__platform_sites__config_id__analytics_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "default": 7,
              "title": "Period",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformAnalyticsSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Site Analytics",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/forms": {
      "get": {
        "description": "List form submissions for a customer's site.",
        "operationId": "list_site_forms_internal_v1_instances__instance_id__platform_sites__config_id__forms_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unread_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Unread Only",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PlatformFormOut"
                  },
                  "title": "Response List Site Forms Internal V1 Instances  Instance Id  Platform Sites  Config Id  Forms Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Site Forms",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/forms/stats": {
      "get": {
        "description": "Get form submission stats for a customer's site.",
        "operationId": "get_site_form_stats_internal_v1_instances__instance_id__platform_sites__config_id__forms_stats_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormStatsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Site Form Stats",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/media": {
      "get": {
        "description": "List media files for a customer's site.",
        "operationId": "list_site_media_internal_v1_instances__instance_id__platform_sites__config_id__media_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Site Media",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/media/upload-url": {
      "post": {
        "description": "Get a presigned R2 upload URL for site media.\n\nThe agent directs the user to PUT their file to the returned URL.\nA WebsiteMedia record is created so list-media returns it immediately.",
        "operationId": "get_media_upload_url_internal_v1_instances__instance_id__platform_sites__config_id__media_upload_url_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaUploadUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Media Upload Url",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/pages": {
      "get": {
        "description": "List all pages for a customer's site.",
        "operationId": "list_site_pages_internal_v1_instances__instance_id__platform_sites__config_id__pages_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PlatformPageOut"
                  },
                  "title": "Response List Site Pages Internal V1 Instances  Instance Id  Platform Sites  Config Id  Pages Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Site Pages",
        "tags": [
          "platform-internal"
        ]
      },
      "post": {
        "description": "Create a new page on a customer's site.",
        "operationId": "create_site_page_internal_v1_instances__instance_id__platform_sites__config_id__pages_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformPageCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Site Page",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/pages/{slug}": {
      "delete": {
        "description": "Delete a page from a customer's site.",
        "operationId": "delete_site_page_internal_v1_instances__instance_id__platform_sites__config_id__pages__slug__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Site Page",
        "tags": [
          "platform-internal"
        ]
      },
      "get": {
        "description": "Get a single page by slug.",
        "operationId": "get_site_page_internal_v1_instances__instance_id__platform_sites__config_id__pages__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformPageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Site Page",
        "tags": [
          "platform-internal"
        ]
      },
      "put": {
        "description": "Update a page's content. Creates a version snapshot on content/title changes.",
        "operationId": "update_site_page_internal_v1_instances__instance_id__platform_sites__config_id__pages__slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformPageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Site Page",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/platform/sites/{config_id}/publish": {
      "post": {
        "description": "Trigger a site redeploy for a customer's site.\n\nEnqueues the Celery redeploy task. The agent can call this after\nediting pages to push changes live.",
        "operationId": "publish_site_internal_v1_instances__instance_id__platform_sites__config_id__publish_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Publish Site",
        "tags": [
          "platform-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/plugin-tools/{tool_name}": {
      "post": {
        "description": "Execute a plugin tool call from the agent runtime.\n\nAuth: Bearer proxy key. Records a usage_event with modality=plugin_tool.",
        "operationId": "execute_plugin_tool_internal_v1_instances__instance_id__plugin_tools__tool_name__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tool_name",
            "required": true,
            "schema": {
              "title": "Tool Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecuteOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Execute Plugin Tool",
        "tags": [
          "plugins-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/quotes": {
      "get": {
        "operationId": "internal_list_quotes_internal_v1_instances__instance_id__quotes_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal List Quotes",
        "tags": [
          "finance"
        ]
      },
      "post": {
        "operationId": "internal_create_quote_internal_v1_instances__instance_id__quotes_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Create Quote",
        "tags": [
          "finance"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/quotes/{quote_id}": {
      "get": {
        "operationId": "internal_get_quote_internal_v1_instances__instance_id__quotes__quote_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "quote_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Quote Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Get Quote",
        "tags": [
          "finance"
        ]
      },
      "patch": {
        "operationId": "internal_update_quote_internal_v1_instances__instance_id__quotes__quote_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "quote_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Quote Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Update Quote",
        "tags": [
          "finance"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/resolve-domain": {
      "get": {
        "description": "Resolve a hostname to a customer_id for shared hosting.\n\nMaps domain \u2192 TenantWebsiteConfig \u2192 customer_id. Used by the runtime\non shared instances to identify which customer a chat request belongs to\nbased on the Host header.",
        "operationId": "resolve_domain_to_customer_internal_v1_instances__instance_id__resolve_domain_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "hostname",
            "required": true,
            "schema": {
              "title": "Hostname",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainResolveOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Domain To Customer",
        "tags": [
          "shared-hosting-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/resolve-model": {
      "get": {
        "description": "Resolve the best model + API key for a given instance and task.\n\nAuth: proxy-key (Bearer header). Returns decrypted credentials \u2014\nMUST be authenticated.\n\nModel resolution order:\n1. Instance agent_config.model_policy[task].primary\n2. Tenant-level model_override.primary_model (if no instance policy)\n3. Platform default (minimax/m2.7)\n\nKey resolution (BYOK hierarchy):\n1. Instance MCP credential (slug=\"llm/{provider}\")\n2. Tenant MCP credential (slug=\"llm/{provider}\", instance_id IS NULL)\n3. Platform env var",
        "operationId": "resolve_model_for_instance_internal_v1_instances__instance_id__resolve_model_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "task",
            "required": false,
            "schema": {
              "default": "chat",
              "title": "Task",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedModelWithKey"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Model For Instance",
        "tags": [
          "model-catalog-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/roster/cascade": {
      "post": {
        "operationId": "internal_start_cascade_internal_v1_instances__instance_id__roster_cascade_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CascadeStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Start Cascade",
        "tags": [
          "roster"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/roster/respond": {
      "post": {
        "operationId": "internal_roster_respond_internal_v1_instances__instance_id__roster_respond_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RosterResponseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Roster Respond",
        "tags": [
          "roster"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/roster/shift-status/{shift_id}": {
      "get": {
        "operationId": "internal_shift_fill_status_internal_v1_instances__instance_id__roster_shift_status__shift_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shift_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Shift Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Shift Fill Status",
        "tags": [
          "roster"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/route-to-agent": {
      "post": {
        "description": "Route a message from one agent to another (handoff).\n\nResolution order:\n1. target_instance_id \u2014 direct routing if specified\n2. target_role \u2014 find instance by agent config role for the same customer",
        "operationId": "route_to_agent_internal_v1_instances__instance_id__route_to_agent_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteToAgentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Route To Agent",
        "tags": [
          "agent-routing"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/safetyculture/actions": {
      "get": {
        "description": "List corrective actions.",
        "operationId": "list_actions_internal_v1_instances__instance_id__safetyculture_actions_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "default": "",
              "title": "Status",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Actions",
        "tags": [
          "safetyculture"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/safetyculture/inspections": {
      "get": {
        "description": "List recent inspections from SafetyCulture.",
        "operationId": "list_inspections_internal_v1_instances__instance_id__safetyculture_inspections_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "template_id",
            "required": false,
            "schema": {
              "default": "",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "modified_after",
            "required": false,
            "schema": {
              "default": "",
              "title": "Modified After",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Inspections",
        "tags": [
          "safetyculture"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/safetyculture/inspections/{audit_id}": {
      "get": {
        "description": "Get full inspection details.",
        "operationId": "get_inspection_internal_v1_instances__instance_id__safetyculture_inspections__audit_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "audit_id",
            "required": true,
            "schema": {
              "title": "Audit Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Inspection",
        "tags": [
          "safetyculture"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/safetyculture/templates": {
      "get": {
        "description": "List inspection templates.",
        "operationId": "list_sc_templates_internal_v1_instances__instance_id__safetyculture_templates_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Sc Templates",
        "tags": [
          "safetyculture"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/schedules": {
      "get": {
        "operationId": "list_schedules_internal_internal_v1_instances__instance_id__schedules_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer 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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Schedules Internal Internal V1 Instances  Instance Id  Schedules Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Schedules Internal",
        "tags": [
          "scheduled-actions-internal"
        ]
      },
      "post": {
        "operationId": "create_schedule_internal_internal_v1_instances__instance_id__schedules_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Schedule Internal",
        "tags": [
          "scheduled-actions-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/schedules/{schedule_id}": {
      "delete": {
        "operationId": "delete_schedule_internal_internal_v1_instances__instance_id__schedules__schedule_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Schedule Internal",
        "tags": [
          "scheduled-actions-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/secrets/refresh": {
      "post": {
        "description": "Refresh agent secrets for running instance.\n\nRequires:\n- mTLS client cert matching instance\n- VPN IP verification\n- WireGuard public key verification\n- Instance status = 'running'\n\nArgs:\n    instance_id: Instance UUID\n    request_body: VPN IP + WG public key\n    request: FastAPI request (for mTLS cert extraction)\n    db: Database session\n\nReturns:\n    agent_secrets: Refreshed secrets (API keys, etc.)\n\nErrors:\n    401: Invalid mTLS cert or identity verification failed\n    404: Instance not found\n    409: Instance not running",
        "operationId": "refresh_secrets_internal_v1_instances__instance_id__secrets_refresh_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretsRefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretsRefreshResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh Secrets",
        "tags": [
          "lifecycle"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/send-form": {
      "post": {
        "description": "Generate a magic-link token for a form and create a draft submission.\n\nCalled by the platform:forms skill when an agent says \"onboard Dave\".\nReturns the form URL + token for the agent to send via SMS/WhatsApp.",
        "operationId": "send_form_link_internal_v1_instances__instance_id__send_form_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendFormRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Form Link",
        "tags": [
          "platform-forms-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/sheets/list": {
      "get": {
        "operationId": "list_spreadsheets_internal_v1_instances__instance_id__sheets_list_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          },
          {
            "description": "Search query for spreadsheet name",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search query for spreadsheet name",
              "title": "Query"
            }
          },
          {
            "in": "query",
            "name": "max_results",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Max Results",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Spreadsheets",
        "tags": [
          "google-sheets"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/sheets/read": {
      "get": {
        "operationId": "read_sheet_range_internal_v1_instances__instance_id__sheets_read_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "spreadsheet_id",
            "required": true,
            "schema": {
              "title": "Spreadsheet Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "default": "Sheet1",
              "title": "Range",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "connection_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Sheet Range",
        "tags": [
          "google-sheets"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/shifts": {
      "get": {
        "operationId": "list_shifts_internal_v1_instances__instance_id__shifts_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "date_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date From"
            }
          },
          {
            "in": "query",
            "name": "date_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date To"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Shifts",
        "tags": [
          "jobs-shifts"
        ]
      },
      "post": {
        "operationId": "create_shift_internal_v1_instances__instance_id__shifts_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShiftCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Shift",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/shifts/{shift_id}": {
      "patch": {
        "description": "Update shift details. Auth: Bearer proxy key.",
        "operationId": "update_shift_internal_v1_instances__instance_id__shifts__shift_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shift_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Shift Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShiftUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Shift",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/shifts/{shift_id}/assign": {
      "post": {
        "operationId": "assign_person_internal_v1_instances__instance_id__shifts__shift_id__assign_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shift_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Shift Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Assign Person",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/shifts/{shift_id}/assignments": {
      "get": {
        "operationId": "list_assignments_internal_v1_instances__instance_id__shifts__shift_id__assignments_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shift_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Shift Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Assignments",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/shifts/{shift_id}/assignments/{assignment_id}": {
      "patch": {
        "operationId": "update_assignment_internal_v1_instances__instance_id__shifts__shift_id__assignments__assignment_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shift_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Shift Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "assignment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Assignment Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignmentUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Assignment",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/staff": {
      "get": {
        "description": "Query staff with qualification filters. Auth: Bearer proxy key.",
        "operationId": "query_staff_internal_internal_v1_instances__instance_id__staff_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated skills to filter by",
            "in": "query",
            "name": "skills",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated skills to filter by",
              "title": "Skills"
            }
          },
          {
            "description": "Site induction required",
            "in": "query",
            "name": "induction_site",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Site induction required",
              "title": "Induction Site"
            }
          },
          {
            "description": "Certification type required (checks expiry)",
            "in": "query",
            "name": "cert_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Certification type required (checks expiry)",
              "title": "Cert Type"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "tier",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 5,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tier"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Query Staff Internal",
        "tags": [
          "staff"
        ]
      },
      "post": {
        "description": "Create a staff record. Auth: Bearer proxy key.",
        "operationId": "create_staff_internal_internal_v1_instances__instance_id__staff_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Staff Internal",
        "tags": [
          "staff"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/staff/expiring-certs": {
      "get": {
        "description": "List staff with certs expiring within N days. Auth: Bearer proxy key.",
        "operationId": "expiring_certs_internal_internal_v1_instances__instance_id__staff_expiring_certs_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "within_days",
            "required": false,
            "schema": {
              "default": 42,
              "maximum": 365,
              "minimum": 1,
              "title": "Within Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Expiring Certs Internal",
        "tags": [
          "staff"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/staff/import": {
      "post": {
        "description": "Bulk import staff. Auth: Bearer proxy key.",
        "operationId": "import_staff_internal_internal_v1_instances__instance_id__staff_import_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffBulkCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Staff Internal",
        "tags": [
          "staff"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/staff/{person_id}": {
      "get": {
        "description": "Get a single staff member. Auth: Bearer proxy key.",
        "operationId": "get_staff_internal_internal_v1_instances__instance_id__staff__person_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "person_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Person Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Staff Internal",
        "tags": [
          "staff"
        ]
      },
      "patch": {
        "description": "Update a staff member. Auth: Bearer proxy key.",
        "operationId": "update_staff_internal_internal_v1_instances__instance_id__staff__person_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "person_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Person Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Staff Internal",
        "tags": [
          "staff"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/telemetry": {
      "post": {
        "description": "Ingest LLM usage telemetry from a VPS agent.\n\nSecurity:\n  - mTLS: client cert must match instance\n  - Idempotent: duplicate request_ids are silently skipped\n  - Anti-replay: events older than 24h are rejected\n  - Cost verification: server recalculates cost from pricing table\n\n\"I find your lack of faith disturbing.\" \u2014 Darth Vader\n(about agents that don't report their usage)",
        "operationId": "ingest_telemetry_internal_v1_instances__instance_id__telemetry_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelemetryBatchIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelemetryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ingest Telemetry",
        "tags": [
          "telemetry"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/timesheets": {
      "get": {
        "operationId": "internal_list_timesheets_internal_v1_instances__instance_id__timesheets_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "person_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Person Id"
            }
          },
          {
            "in": "query",
            "name": "approval_status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Approval Status"
            }
          },
          {
            "in": "query",
            "name": "date_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date From"
            }
          },
          {
            "in": "query",
            "name": "date_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date To"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal List Timesheets",
        "tags": [
          "finance"
        ]
      },
      "post": {
        "operationId": "internal_create_timesheet_internal_v1_instances__instance_id__timesheets_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimesheetCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Create Timesheet",
        "tags": [
          "finance"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/timesheets/{entry_id}/approve": {
      "patch": {
        "operationId": "internal_approve_timesheet_internal_v1_instances__instance_id__timesheets__entry_id__approve_patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "entry_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Entry Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimesheetApproval"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Internal Approve Timesheet",
        "tags": [
          "finance"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/usage": {
      "post": {
        "description": "Record a usage event from the agent runtime. Proxy-key auth.",
        "operationId": "record_usage_internal_v1_instances__instance_id__usage_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordUsageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Record Usage Internal V1 Instances  Instance Id  Usage Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Record Usage",
        "tags": [
          "usage-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/usage/spend": {
      "get": {
        "description": "Get real-time daily spend from Redis. Proxy-key auth.",
        "operationId": "get_spend_internal_v1_instances__instance_id__usage_spend_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Get Spend Internal V1 Instances  Instance Id  Usage Spend Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Spend",
        "tags": [
          "usage-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/voice/batch-call": {
      "post": {
        "description": "Initiate batch outbound calls (rostering cascade).",
        "operationId": "initiate_batch_calls_internal_v1_instances__instance_id__voice_batch_call_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Initiate Batch Calls",
        "tags": [
          "voice-outbound"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/voice/batch-results": {
      "post": {
        "description": "Voice agent reports batch call results.",
        "operationId": "voice_batch_results_report_internal_v1_instances__instance_id__voice_batch_results_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Voice Batch Results Report",
        "tags": [
          "voice-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/voice/call": {
      "post": {
        "description": "Initiate a single outbound call via Retell.",
        "operationId": "initiate_outbound_call_internal_v1_instances__instance_id__voice_call_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundCallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Initiate Outbound Call",
        "tags": [
          "voice-outbound"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/voice/call-ended": {
      "post": {
        "description": "Voice agent reports call ended \u2014 creates workflow record.\n\nCalled by the voice agent on the VPS after a call completes.\nThis is how Pipecat calls get recorded (vs Retell which uses webhooks).",
        "operationId": "voice_call_ended_report_internal_v1_instances__instance_id__voice_call_ended_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Voice Call Ended Report",
        "tags": [
          "voice-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker-bindings": {
      "get": {
        "description": "List all bindings for a customer.",
        "operationId": "list_bindings_internal_v1_instances__instance_id__worker_bindings_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Bindings",
        "tags": [
          "worker-bindings"
        ]
      },
      "post": {
        "description": "Create a person-channel binding. Auth: Bearer proxy key.",
        "operationId": "create_binding_internal_v1_instances__instance_id__worker_bindings_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BindingCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Binding",
        "tags": [
          "worker-bindings"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker-bindings/{binding_id}/rebind": {
      "post": {
        "description": "Rebind a worker to a new channel address. Revokes old, creates unverified new.",
        "operationId": "rebind_channel_internal_v1_instances__instance_id__worker_bindings__binding_id__rebind_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "binding_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Binding Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RebindRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rebind Channel",
        "tags": [
          "worker-bindings"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker-bindings/{binding_id}/revoke": {
      "post": {
        "description": "Revoke a worker-channel binding.",
        "operationId": "revoke_binding_internal_v1_instances__instance_id__worker_bindings__binding_id__revoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "binding_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Binding Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Binding",
        "tags": [
          "worker-bindings"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker/me/assignments": {
      "get": {
        "operationId": "my_assignments_internal_v1_instances__instance_id__worker_me_assignments_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_type",
            "required": true,
            "schema": {
              "title": "Channel Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_address",
            "required": true,
            "schema": {
              "title": "Channel Address",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "My Assignments",
        "tags": [
          "worker"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker/me/certs": {
      "get": {
        "operationId": "my_certs_internal_v1_instances__instance_id__worker_me_certs_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_type",
            "required": true,
            "schema": {
              "title": "Channel Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_address",
            "required": true,
            "schema": {
              "title": "Channel Address",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "My Certs",
        "tags": [
          "worker"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker/me/shifts": {
      "get": {
        "operationId": "my_shifts_internal_v1_instances__instance_id__worker_me_shifts_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_type",
            "required": true,
            "schema": {
              "title": "Channel Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_address",
            "required": true,
            "schema": {
              "title": "Channel Address",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "My Shifts",
        "tags": [
          "worker"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker/me/timesheet": {
      "post": {
        "operationId": "log_my_hours_internal_v1_instances__instance_id__worker_me_timesheet_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_type",
            "required": true,
            "schema": {
              "title": "Channel Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_address",
            "required": true,
            "schema": {
              "title": "Channel Address",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkerTimesheetCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Log My Hours",
        "tags": [
          "worker"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker/me/timesheets": {
      "get": {
        "operationId": "my_timesheets_internal_v1_instances__instance_id__worker_me_timesheets_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_type",
            "required": true,
            "schema": {
              "title": "Channel Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel_address",
            "required": true,
            "schema": {
              "title": "Channel Address",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "My Timesheets",
        "tags": [
          "worker"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/worker/verify": {
      "post": {
        "description": "Process a worker's verification response. Upgrades binding state.",
        "operationId": "verify_worker_binding_internal_v1_instances__instance_id__worker_verify_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Worker Binding",
        "tags": [
          "worker"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/workflows": {
      "get": {
        "description": "Query workflow records. Called by agent runtime via platform skill.\nAuth: Bearer proxy key.",
        "operationId": "query_workflows_internal_internal_v1_instances__instance_id__workflows_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "workflow_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Workflow Type"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "reference",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Reference"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Query Workflows Internal",
        "tags": [
          "workflows"
        ]
      },
      "post": {
        "description": "Create a new workflow record. Called by agent runtime via platform skill.\nAuth: Bearer proxy key.",
        "operationId": "create_workflow_internal_v1_instances__instance_id__workflows_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__workflows__WorkflowCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflows__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/workflows/active": {
      "get": {
        "description": "Fetch active workflows for an instance. Called by the runtime middleware.\n\nIf workflow_slugs is provided (comma-separated), only return those workflows.\nThis allows the runtime to scope by recipe's workflow_slugs.\nIf omitted, returns all active workflows for the tenant.",
        "operationId": "get_active_workflows_for_instance_internal_v1_instances__instance_id__workflows_active_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workflow_slugs",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Workflow Slugs"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Active Workflows For Instance",
        "tags": [
          "workflows-internal"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/workflows/{workflow_id}": {
      "get": {
        "description": "Get a single workflow record. Auth: Bearer proxy key.",
        "operationId": "get_workflow_internal_internal_v1_instances__instance_id__workflows__workflow_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflows__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Workflow Internal",
        "tags": [
          "workflows"
        ]
      },
      "patch": {
        "description": "Advance a workflow's state. Called by agent runtime via platform skill.\nAuth: Bearer proxy key.",
        "operationId": "advance_workflow_internal_v1_instances__instance_id__workflows__workflow_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowAdvance"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflows__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Advance Workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/workflows/{workflow_id}/resume": {
      "post": {
        "description": "Resume a suspended workflow from the agent runtime. Auth: Bearer proxy key.",
        "operationId": "resume_workflow_internal_internal_v1_instances__instance_id__workflows__workflow_id__resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResumeWorkflowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResumeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resume Workflow Internal",
        "tags": [
          "workflows"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/workflows/{workflow_id}/suspend": {
      "post": {
        "description": "Suspend a workflow from the agent runtime. Auth: Bearer proxy key.",
        "operationId": "suspend_workflow_internal_internal_v1_instances__instance_id__workflows__workflow_id__suspend_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuspendWorkflowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResumeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Suspend Workflow Internal",
        "tags": [
          "workflows"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/xero/contacts": {
      "get": {
        "description": "Search contacts in Xero.",
        "operationId": "search_xero_contacts_internal_v1_instances__instance_id__xero_contacts_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "required": false,
            "schema": {
              "default": "",
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "default": "",
              "title": "Email",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Xero Contacts",
        "tags": [
          "xero"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/xero/invoices": {
      "post": {
        "description": "Create an invoice in Xero from the agent.",
        "operationId": "create_xero_invoice_internal_v1_instances__instance_id__xero_invoices_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XeroInvoiceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Xero Invoice",
        "tags": [
          "xero"
        ]
      }
    },
    "/internal/v1/instances/{instance_id}/xero/invoices/{invoice_id}": {
      "get": {
        "description": "Get invoice details from Xero (payment status, etc.).",
        "operationId": "get_xero_invoice_internal_v1_instances__instance_id__xero_invoices__invoice_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "title": "Invoice Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Xero Invoice",
        "tags": [
          "xero"
        ]
      }
    },
    "/internal/v1/runtime-images": {
      "get": {
        "description": "List registered images. Defaults to current rows only;\n`include_superseded=true` returns history. Used by the admin\nstaleness page (Patch 5).",
        "operationId": "list_runtime_images_internal_v1_runtime_images_get",
        "parameters": [
          {
            "in": "query",
            "name": "manifest_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Manifest Id"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider"
            }
          },
          {
            "in": "query",
            "name": "include_superseded",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Superseded",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Runtime Images",
        "tags": [
          "runtime-images"
        ]
      },
      "post": {
        "description": "Insert a new row for (manifest_id, provider) and supersede\nthe previous current row in the same transaction.\n\nConcurrency: we acquire a transaction-scoped Postgres advisory\nlock keyed on (manifest_id, provider) before reading the\ncurrent row. SELECT ... FOR UPDATE alone is not sufficient\nbecause:\n  1. The first bake for a slot has no row to lock \u2014 two\n     simultaneous registrations would both pass the partial-\n     unique-index check and one would fail at INSERT.\n  2. After T1 supersedes the existing current row and commits,\n     T2's blocked SELECT FOR UPDATE re-reads, sees no current\n     row, and proceeds to INSERT \u2014 both rows might then race\n     the partial unique check.\nThe advisory lock serialises every code path against the same\nslot, removing both windows. It auto-releases on transaction\nend (commit OR rollback). The lock key is a 64-bit hash of\n\"<manifest_id>:<provider>\"; collisions across unrelated slots\nare harmless (worst case: two unrelated bakes serialise) but\nidentical slots always collide, which is what we want.\n\nIdempotency: re-POST with the same snapshot_id +\ncompatibility_hash for the same slot is a no-op \u2014 useful when a\nbake retries after a transient network blip. The response then\nreports superseded=False with the existing id.",
        "operationId": "register_runtime_image_internal_v1_runtime_images_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__runtime_images__RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register Runtime Image",
        "tags": [
          "runtime-images"
        ]
      }
    },
    "/internal/v1/runtime-images/{image_id}/rollback": {
      "post": {
        "description": "Supersede the named row and un-supersede the most recently\nsuperseded row in the same (manifest, provider) slot.\n\nUsed by the continuous-bake pipeline when a freshly registered\nsnapshot fails its post-bake smoke or soak checks. The previous\n\"current\" row is the one most-recently superseded for the slot \u2014\ntypically the snapshot the just-failed bake replaced.\n\nNo-op contract: if `image_id` is already superseded the call is\nrejected (409) so a stale rollback can't accidentally re-promote\na 3-versions-back snapshot. Callers should check the current row\nvia GET first if there is any doubt.\n\nEmpty-slot guard: if the caller is rolling back the FIRST-EVER\nregistered image for a slot (no previous row to restore), the\nrollback would leave the slot with no current image \u2014 silently\ndegrading future provisions to the GOLDEN_IMAGES_JSON env or\nvanilla ubuntu fallback. For the automated smoke-failure path\nthis is dangerous: it makes a single bad smoke pull the\nplatform off baked images entirely. Default behaviour is now\n409 in that case; pass `?allow_empty_slot=true` for the manual\noperator path where empty-current is genuinely intended (e.g.\ndecommissioning a runtime).\n\nConcurrency: same advisory-lock key as the register path so a\nrollback can't race a concurrent register on the same slot.",
        "operationId": "rollback_runtime_image_internal_v1_runtime_images__image_id__rollback_post",
        "parameters": [
          {
            "in": "path",
            "name": "image_id",
            "required": true,
            "schema": {
              "title": "Image Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "allow_empty_slot",
            "required": false,
            "schema": {
              "default": false,
              "title": "Allow Empty Slot",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rollback Runtime Image",
        "tags": [
          "runtime-images"
        ]
      }
    },
    "/internal/v1/scoring/turn/{instance_id}": {
      "post": {
        "description": "Runtime calls this after each agent response.\n\nAuth: Bearer proxy key (instance-scoped).\nRolls dice against sample_rate. If sampled, enqueues Celery scoring task.",
        "operationId": "score_turn_internal_v1_scoring_turn__instance_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScoreTurnRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScoreTurnResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Score Turn",
        "tags": [
          "scoring"
        ]
      }
    },
    "/internal/v1/smoke/instances/by-key/{idempotency_key}": {
      "get": {
        "description": "Resolve idempotency_key \u2192 instance_id once the worker inserts\nthe row. Same shape as /api/v1/instances/by-key/{idem} but scoped\nto the smoke customer.",
        "operationId": "smoke_poll_internal_v1_smoke_instances_by_key__idempotency_key__get",
        "parameters": [
          {
            "in": "path",
            "name": "idempotency_key",
            "required": true,
            "schema": {
              "title": "Idempotency Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Smoke Poll",
        "tags": [
          "smoke"
        ]
      }
    },
    "/internal/v1/smoke/instances/{instance_id}": {
      "delete": {
        "description": "Soft-delete + provider cleanup for a smoke instance. Mirrors\nthe cleanup recipe in /api/v1/instances DELETE \u2014 same child-row\ndeletes, same hostname suffix, same Hetzner cleanup task.",
        "operationId": "smoke_delete_internal_v1_smoke_instances__instance_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Smoke Delete",
        "tags": [
          "smoke"
        ]
      },
      "get": {
        "operationId": "smoke_status_internal_v1_smoke_instances__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Smoke Status",
        "tags": [
          "smoke"
        ]
      }
    },
    "/internal/v1/smoke/instances/{instance_id}/chat": {
      "post": {
        "description": "One chat turn, SSE streamed from the agent VPS.\n\nStrips the customer-facing chat endpoint's Redis stream lock,\nrate limiter, and renewal loop \u2014 single-consumer CI does not\nneed those, and the smoke fixture is the only customer that\ncan drive this endpoint anyway.",
        "operationId": "smoke_chat_internal_v1_smoke_instances__instance_id__chat_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__smoke__ChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Smoke Chat",
        "tags": [
          "smoke"
        ]
      }
    },
    "/internal/v1/smoke/instances/{instance_id}/llm-events": {
      "get": {
        "description": "Count llm_usage_events rows for a smoke instance within a\nrecent window. Reads the authoritative table directly so a\nfresh chat turn's row is visible immediately (the usage_daily\nrollup customer-facing endpoint hits is too stale for smoke).",
        "operationId": "smoke_llm_events_internal_v1_smoke_instances__instance_id__llm_events_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "window_seconds",
            "required": false,
            "schema": {
              "default": 900,
              "title": "Window Seconds",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmEventsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Smoke Llm Events",
        "tags": [
          "smoke"
        ]
      }
    },
    "/internal/v1/smoke/provision": {
      "post": {
        "description": "Provision a smoke instance via the same Celery task the\ncustomer endpoint uses. Customer / tenant / subscription IDs\ncome from settings \u2014 the request body cannot override them, so\na leaked OPS_BEARER_TOKEN can't be used to create instances\nunder any other customer.",
        "operationId": "smoke_provision_internal_v1_smoke_provision_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__smoke__ProvisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__smoke__ProvisionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Smoke Provision",
        "tags": [
          "smoke"
        ]
      }
    },
    "/v1/admin/runtime-images": {
      "get": {
        "description": "List registered runtime images.\n\nDefaults to current rows only (the snapshot the resolver will\nactually pick at provision time). `include_superseded=true`\nreturns history. Admin-only \u2014 runtime_images is platform metadata\nnot gated by tenant scope.",
        "operationId": "list_runtime_images_v1_admin_runtime_images_get",
        "parameters": [
          {
            "in": "query",
            "name": "manifest_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Manifest Id"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider"
            }
          },
          {
            "in": "query",
            "name": "include_superseded",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Superseded",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Runtime Images",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/alerts": {
      "get": {
        "description": "List operational alerts for this tenant.\n\n\"I see dead people.\" \u2014 Cole Sear, The Sixth Sense\n(about resolved alerts that still show up in the list)",
        "operationId": "list_alerts_v1_alerts_get",
        "parameters": [
          {
            "description": "Filter by severity: critical, warning, info",
            "in": "query",
            "name": "severity",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by severity: critical, warning, info",
              "title": "Severity"
            }
          },
          {
            "description": "Filter by alert type",
            "in": "query",
            "name": "alert_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by alert type",
              "title": "Alert Type"
            }
          },
          {
            "description": "Filter: active (unresolved), acknowledged, resolved, all",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter: active (unresolved), acknowledged, resolved, all",
              "title": "Status"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "description": "Items per page",
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 25,
              "description": "Items per page",
              "maximum": 100,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Alerts",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/alerts/summary": {
      "get": {
        "description": "Get unacknowledged alert counts by severity \u2014 powers the notification bell.\n\n\"By Grabthar's hammer... what a savings.\" \u2014 Dr. Lazarus, Galaxy Quest\n(about the summary query that saves you from loading all alerts)",
        "operationId": "alerts_summary_v1_alerts_summary_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Alerts Summary",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/alerts/{alert_id}/acknowledge": {
      "patch": {
        "description": "Acknowledge an alert \u2014 marks it as seen by a human.\n\n\"I acknowledge your existence.\" \u2014 Spock, probably",
        "operationId": "acknowledge_alert_endpoint_v1_alerts__alert_id__acknowledge_patch",
        "parameters": [
          {
            "in": "path",
            "name": "alert_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Alert Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcknowledgeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Acknowledge Alert Endpoint",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/alerts/{alert_id}/resolve": {
      "patch": {
        "description": "Manually resolve an alert \u2014 marks the condition as cleared.\n\n\"It's over. It's done.\" \u2014 Frodo, Return of the King",
        "operationId": "resolve_alert_endpoint_v1_alerts__alert_id__resolve_patch",
        "parameters": [
          {
            "in": "path",
            "name": "alert_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Alert Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcknowledgeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resolve Alert Endpoint",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/approvals": {
      "get": {
        "description": "List approvals for tenant dashboard.",
        "operationId": "tenant_list_approvals_v1_approvals_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Approvals",
        "tags": [
          "approvals"
        ]
      }
    },
    "/v1/approved-primitives": {
      "get": {
        "operationId": "get_approved_primitives_v1_approved_primitives_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApprovedPrimitivesOut"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Get Approved Primitives V1 Approved Primitives Get"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Approved Primitives",
        "tags": [
          "approved-primitives"
        ]
      },
      "put": {
        "operationId": "set_approved_primitives_v1_approved_primitives_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovedPrimitivesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovedPrimitivesOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Approved Primitives",
        "tags": [
          "approved-primitives"
        ]
      }
    },
    "/v1/billing": {
      "get": {
        "description": "Return current plan + usage for the billing page.\n\n\"I'll be back.\" \u2014 T-800, The Terminator (to check your billing)",
        "operationId": "get_billing_v1_billing_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Billing",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/checkout-session": {
      "post": {
        "description": "Create a Stripe Checkout Session on the tenant's connected account.\n\nThis is the money shot \u2014 Steve clicks a link, enters his card,\nStripe charges Steve, deposits to Matt's bank (minus HydraCore's cut).\n\n\"Here's looking at you, kid.\" \u2014 Rick Blaine, Casablanca\n(about the moment Steve's card gets charged)",
        "operationId": "create_checkout_session_v1_billing_checkout_session_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutSessionIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Checkout Session",
        "tags": [
          "billing-subscriptions"
        ]
      }
    },
    "/v1/billing/tier-pricing": {
      "get": {
        "description": "List all tier pricing configurations for the tenant.\n\n\"Show me the money!\" \u2014 Rod Tidwell, Jerry Maguire",
        "operationId": "list_tier_pricing_v1_billing_tier_pricing_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TierPricingListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Tier Pricing",
        "tags": [
          "billing-subscriptions"
        ]
      },
      "post": {
        "description": "Create tier pricing config \u2014 what Matt charges Steve.\n\n\"You want it? You got it. Toyota.\" \u2014 Every 80s car commercial\n(about setting your own prices)",
        "operationId": "create_tier_pricing_v1_billing_tier_pricing_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TierPricingCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TierPricingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Tier Pricing",
        "tags": [
          "billing-subscriptions"
        ]
      }
    },
    "/v1/billing/tier-pricing/{pricing_id}": {
      "put": {
        "description": "Update tier pricing. Clears cached stripe_price_id if price/interval changes.\n\n\"You're gonna need a bigger boat.\" \u2014 Brody, Jaws (about price increases)",
        "operationId": "update_tier_pricing_v1_billing_tier_pricing__pricing_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "pricing_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Pricing Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TierPricingUpdateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TierPricingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Tier Pricing",
        "tags": [
          "billing-subscriptions"
        ]
      }
    },
    "/v1/billing/trial-status": {
      "get": {
        "description": "Fast trial status check \u2014 just subscription + trial dates.\n\n\"I've seen things you people wouldn't believe...\"\n\u2014 Roy Batty, Blade Runner (about expired trials)",
        "operationId": "get_trial_status_v1_billing_trial_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrialStatusOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Trial Status",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/usage": {
      "get": {
        "description": "Detailed usage breakdown with per-instance split and allowance tracking.\n\n\"I'm not bad. I'm just drawn that way.\" \u2014 Jessica Rabbit\n(about token consumption patterns)",
        "operationId": "get_usage_v1_billing_usage_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageDetailOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Usage",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/usage/chart": {
      "get": {
        "description": "Daily usage time series, optionally filtered to a single instance.\n\n\"Where we're going, we don't need roads.\" \u2014 Doc Brown\n(about charting token usage into the future)",
        "operationId": "get_usage_chart_v1_billing_usage_chart_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageChartOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Usage Chart",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/brand": {
      "get": {
        "description": "Get the current tenant's branding config.\n\nReturns defaults if no branding row exists yet (auto-creates one).\n\n\"Frankly, my dear, I don't give a damn.\" - Rhett Butler\n(what your brand says when competitors try to copy it)",
        "operationId": "get_branding_v1_brand_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Branding",
        "tags": [
          "branding"
        ]
      },
      "put": {
        "description": "Update the current tenant's branding config.\n\nRequires admin role. Partial update - only provided fields are changed.\n\n\"With great power comes great responsibility.\" - Uncle Ben\n(also applies to brand color choices)",
        "operationId": "update_branding_v1_brand_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Branding",
        "tags": [
          "branding"
        ]
      }
    },
    "/v1/brand/logo": {
      "post": {
        "description": "Upload a brand logo image.\n\nAccepts PNG, JPEG, WebP, SVG, GIF up to 2 MB.\nStores on local filesystem (swappable to R2/S3 later).\nUpdates the branding record's logo_url.\n\n\"Say hello to my little friend!\" - Tony Montana, Scarface\n(what your logo says to every visitor)",
        "operationId": "upload_logo_v1_brand_logo_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_logo_v1_brand_logo_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Upload Logo",
        "tags": [
          "branding"
        ]
      }
    },
    "/v1/brand/logo/{filename}": {
      "get": {
        "description": "Serve an uploaded logo file.\n\nNo auth required - logos are public assets for customer-facing sites.\n\"If you build it, they will come.\" - Field of Dreams",
        "operationId": "serve_logo_v1_brand_logo__filename__get",
        "parameters": [
          {
            "in": "path",
            "name": "filename",
            "required": true,
            "schema": {
              "title": "Filename",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Serve Logo",
        "tags": [
          "branding"
        ]
      }
    },
    "/v1/catalog/integrations": {
      "get": {
        "description": "Return all integrations from preset definitions.\n\n\"Do you expect me to talk?\" \"No, Mr Bond, I expect you to integrate!\"\n\u2014 Goldfinger (about OAuth flows)",
        "operationId": "list_integrations_v1_catalog_integrations_get",
        "parameters": [
          {
            "description": "Filter by preset ID",
            "in": "query",
            "name": "preset_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by preset ID",
              "title": "Preset Id"
            }
          },
          {
            "description": "Filter by category",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category",
              "title": "Category"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/IntegrationOut"
                  },
                  "title": "Response List Integrations V1 Catalog Integrations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Integrations",
        "tags": [
          "catalog"
        ]
      }
    },
    "/v1/catalog/regions": {
      "get": {
        "description": "Return all active regions.\n\n\"Roads? Where we're going, we don't need roads.\" - Doc Brown",
        "operationId": "list_regions_v1_catalog_regions_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RegionOut"
                  },
                  "title": "Response List Regions V1 Catalog Regions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Regions",
        "tags": [
          "catalog"
        ]
      }
    },
    "/v1/catalog/skills": {
      "get": {
        "description": "Return all skills from SKILL.md manifests, cross-referenced with presets.\n\nNo mocks. No stubs. Parsed from real SKILL.md frontmatter on disk.\n\n\"There is no spoon.\" \u2014 Neo, The Matrix (about mock data)",
        "operationId": "list_skills_v1_catalog_skills_get",
        "parameters": [
          {
            "description": "Filter by preset ID",
            "in": "query",
            "name": "preset_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by preset ID",
              "title": "Preset Id"
            }
          },
          {
            "description": "Filter by category (base, support, trades)",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category (base, support, trades)",
              "title": "Category"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__catalog__SkillOut"
                  },
                  "title": "Response List Skills V1 Catalog Skills Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skills",
        "tags": [
          "catalog"
        ]
      }
    },
    "/v1/catalog/tiers": {
      "get": {
        "description": "Return all active product tiers across all active products.\n\n\"I love it when a plan comes together.\" - Hannibal Smith, The A-Team",
        "operationId": "list_tiers_v1_catalog_tiers_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TierOut"
                  },
                  "title": "Response List Tiers V1 Catalog Tiers Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Tiers",
        "tags": [
          "catalog"
        ]
      }
    },
    "/v1/channels/whatsapp/callback": {
      "get": {
        "description": "Handle Meta OAuth callback after Embedded Signup.\n\n1. Verify state parameter (CSRF protection)\n2. Exchange code for long-lived access token\n3. Fetch WABA and phone number details\n4. Create channel_endpoint + encrypted credentials\n5. Return success with phone number info",
        "operationId": "embedded_signup_callback_v1_channels_whatsapp_callback_get",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "title": "Code",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "title": "State",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddedSignupCompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Embedded Signup Callback",
        "tags": [
          "whatsapp-embedded-signup"
        ]
      }
    },
    "/v1/conversations": {
      "get": {
        "description": "List conversations across all consented instances (or one specific instance).\n\nOnly returns conversations from instances where consent_debug_access=True.",
        "operationId": "fleet_conversations_v1_conversations_get",
        "parameters": [
          {
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Instance Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetConversationsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Fleet Conversations",
        "tags": [
          "conversations"
        ]
      }
    },
    "/v1/conversations/overview": {
      "get": {
        "description": "Fleet-wide inbox overview \u2014 shows all instances and their consent status.\n\nInstances with consent get a conversation count from the agent runtime.\nInstances without consent show as locked (count=None).",
        "operationId": "fleet_inbox_overview_v1_conversations_overview_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetInboxOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Fleet Inbox Overview",
        "tags": [
          "conversations"
        ]
      }
    },
    "/v1/conversations/{instance_id}/{conversation_id}": {
      "get": {
        "description": "Get full conversation detail from a specific instance.\n\nProxies directly to the agent runtime. Requires consent_debug_access.",
        "operationId": "fleet_conversation_detail_v1_conversations__instance_id___conversation_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "conversation_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9:_-]{1,128}$",
              "title": "Conversation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Fleet Conversation Detail",
        "tags": [
          "conversations"
        ]
      }
    },
    "/v1/customer-auth/login": {
      "post": {
        "description": "Send a 6-digit login code to the customer's email.\n\nAlways returns success to prevent email enumeration.",
        "operationId": "customer_login_v1_customer_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Customer Login V1 Customer Auth Login Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Customer Login",
        "tags": [
          "customer-auth"
        ]
      }
    },
    "/v1/customer-auth/logout": {
      "post": {
        "description": "Revoke customer refresh token and clear portal cookies.",
        "operationId": "customer_logout_v1_customer_auth_logout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Customer Logout",
        "tags": [
          "customer-auth"
        ]
      }
    },
    "/v1/customer-auth/refresh": {
      "post": {
        "description": "Rotate customer access + refresh tokens.",
        "operationId": "customer_refresh_v1_customer_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Customer Refresh",
        "tags": [
          "customer-auth"
        ]
      }
    },
    "/v1/customer-auth/token": {
      "post": {
        "description": "Programmatic portal token endpoint \u2014 exchanges magic-link code for tokens, NEVER sets cookies.",
        "operationId": "customer_programmatic_token_v1_customer_auth_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerProgrammaticTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Customer Programmatic Token",
        "tags": [
          "customer-auth"
        ]
      }
    },
    "/v1/customer-auth/verify": {
      "post": {
        "description": "Exchange a 6-digit code for access + refresh tokens.",
        "operationId": "customer_verify_v1_customer_auth_verify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Customer Verify",
        "tags": [
          "customer-auth"
        ]
      }
    },
    "/v1/customers": {
      "get": {
        "description": "List all end-customers for the current tenant.\n\nAdmin-only. Supports pagination, search by email and sorting.\nRLS ensures only the current tenant's customers are visible.\n\n\"Round up the usual suspects.\" - Captain Renault, Casablanca",
        "operationId": "list_customers_v1_customers_get",
        "parameters": [
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "description": "Items per page",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 20,
              "description": "Items per page",
              "maximum": 100,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "description": "Search by email",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "default": "",
              "description": "Search by email",
              "title": "Search",
              "type": "string"
            }
          },
          {
            "description": "Sort field",
            "in": "query",
            "name": "sort_by",
            "required": false,
            "schema": {
              "default": "created_at",
              "description": "Sort field",
              "title": "Sort By",
              "type": "string"
            }
          },
          {
            "description": "Sort direction: asc or desc",
            "in": "query",
            "name": "sort_dir",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: asc or desc",
              "title": "Sort Dir",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Customers",
        "tags": [
          "customers"
        ]
      },
      "post": {
        "description": "Create a new end-customer for the current tenant.\n\nAdmin-only. This is how tenants (e.g. CrewAmp) onboard their customers\n(e.g. IQM, Steve) programmatically or via the dashboard.\n\nDuplicate email within the same tenant is rejected.",
        "operationId": "create_customer_v1_customers_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCreatedOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Customer",
        "tags": [
          "customers"
        ]
      }
    },
    "/v1/customers/lookup/identity": {
      "get": {
        "description": "Reverse lookup: find which customer owns a given channel identity.\n\nUsed by the agent runtime to resolve \"who is Telegram user 12345?\"\nbefore enriching the conversation context.\n\n\"Say my name.\" \u2014 Walter White, Breaking Bad",
        "operationId": "lookup_identity_v1_customers_lookup_identity_get",
        "parameters": [
          {
            "description": "Channel type",
            "in": "query",
            "name": "channel",
            "required": true,
            "schema": {
              "description": "Channel type",
              "title": "Channel",
              "type": "string"
            }
          },
          {
            "description": "External ID to look up",
            "in": "query",
            "name": "external_id",
            "required": true,
            "schema": {
              "description": "External ID to look up",
              "title": "External Id",
              "type": "string"
            }
          },
          {
            "description": "Optional instance scope",
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional instance scope",
              "title": "Instance Id"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__customer_identities__IdentityLookupOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Lookup Identity",
        "tags": [
          "customer-identities"
        ]
      }
    },
    "/v1/customers/{customer_id}": {
      "get": {
        "description": "Get detailed info for a single customer.\n\n\"You're gonna need a bigger boat.\" - Chief Brody, Jaws\n(what you say when a customer's instance count keeps growing)",
        "operationId": "get_customer_v1_customers__customer_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDetailOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Customer",
        "tags": [
          "customers"
        ]
      }
    },
    "/v1/customers/{customer_id}/clone": {
      "post": {
        "description": "Clone a customer's rules to a new customer. 'Set up like Steve but for this new plumber.'",
        "operationId": "clone_customer_setup_v1_customers__customer_id__clone_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneCustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCreatedOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Clone Customer Setup",
        "tags": [
          "customers"
        ]
      }
    },
    "/v1/customers/{customer_id}/connections": {
      "get": {
        "operationId": "list_connections_v1_customers__customer_id__connections_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Connections",
        "tags": [
          "connections"
        ]
      },
      "post": {
        "operationId": "create_connection_v1_customers__customer_id__connections_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Connection",
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/customers/{customer_id}/connections/{connection_id}": {
      "delete": {
        "operationId": "delete_connection_v1_customers__customer_id__connections__connection_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Connection",
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/customers/{customer_id}/connections/{connection_id}/grants": {
      "post": {
        "operationId": "create_grant_v1_customers__customer_id__connections__connection_id__grants_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrantCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__connections__GrantOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Grant",
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/customers/{customer_id}/connections/{connection_id}/grants/{grant_id}": {
      "delete": {
        "operationId": "delete_grant_v1_customers__customer_id__connections__connection_id__grants__grant_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Grant",
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/customers/{customer_id}/identities": {
      "get": {
        "description": "List all external identities linked to a customer.\n\n\"I'm Batman.\" \u2014 Batman (about identity, obviously)",
        "operationId": "list_customer_identities_v1_customers__customer_id__identities_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by channel",
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by channel",
              "title": "Channel"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/IdentityOut"
                  },
                  "title": "Response List Customer Identities V1 Customers  Customer Id  Identities Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Customer Identities",
        "tags": [
          "customer-identities"
        ]
      },
      "post": {
        "description": "Link an external channel identity to a customer.\n\n\"We can do this the easy way, or the hard way.\" \u2014 every cop movie ever",
        "operationId": "create_customer_identity_v1_customers__customer_id__identities_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Customer Identity",
        "tags": [
          "customer-identities"
        ]
      }
    },
    "/v1/customers/{customer_id}/identities/{identity_id}": {
      "delete": {
        "description": "Unlink an external identity from a customer.\n\n\"Forget about it, Jake. It's Chinatown.\" \u2014 Walsh, Chinatown",
        "operationId": "delete_customer_identity_v1_customers__customer_id__identities__identity_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Identity Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Customer Identity",
        "tags": [
          "customer-identities"
        ]
      },
      "patch": {
        "description": "Update an identity link (display name, verification status, metadata).\n\n\"I've made a huge mistake.\" \u2014 Gob Bluth, Arrested Development\n(about linking the wrong Telegram to the wrong customer)",
        "operationId": "update_customer_identity_v1_customers__customer_id__identities__identity_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Identity Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Customer Identity",
        "tags": [
          "customer-identities"
        ]
      }
    },
    "/v1/customers/{customer_id}/identities/{identity_id}/claim-code": {
      "post": {
        "description": "Generate a one-time claim code for an unverified identity.\n\nMatt clicks \"Generate Code\" in the dashboard, reads the 6-char code to Steve,\nSteve types /claim CODE in Telegram, platform verifies and marks identity\nas verified + owner.\n\n\"The code is... one, two, three, four, five. That's the stupidest\ncombination I've ever heard in my life!\" \u2014 Dark Helmet, Spaceballs\n(Our codes are considerably better than that.)",
        "operationId": "generate_identity_claim_code_v1_customers__customer_id__identities__identity_id__claim_code_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Identity Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimCodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Generate Identity Claim Code",
        "tags": [
          "customer-identities"
        ]
      }
    },
    "/v1/customers/{customer_id}/import/csv-to-entities": {
      "post": {
        "description": "Import entity records from CSV/paste data. Tenant dashboard.",
        "operationId": "csv_import_entities_v1_customers__customer_id__import_csv_to_entities_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CsvEntityImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Csv Import Entities",
        "tags": [
          "sheet-import"
        ]
      }
    },
    "/v1/customers/{customer_id}/import/csv-to-staff": {
      "post": {
        "description": "Import staff from CSV/paste data (2D array). Tenant dashboard.",
        "operationId": "csv_import_staff_v1_customers__customer_id__import_csv_to_staff_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CsvStaffImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Csv Import Staff",
        "tags": [
          "sheet-import"
        ]
      }
    },
    "/v1/customers/{customer_id}/import/sheet-to-entities": {
      "post": {
        "description": "Import entity records from a Google Sheet. Auth: JWT (admin only).",
        "operationId": "tenant_import_sheet_to_entities_v1_customers__customer_id__import_sheet_to_entities_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantSheetToEntitiesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Import Sheet To Entities",
        "tags": [
          "sheet-import"
        ]
      }
    },
    "/v1/customers/{customer_id}/import/sheet-to-staff": {
      "post": {
        "description": "Import staff from a Google Sheet. Auth: JWT (admin only).",
        "operationId": "tenant_import_sheet_to_staff_v1_customers__customer_id__import_sheet_to_staff_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantSheetToStaffRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Import Sheet To Staff",
        "tags": [
          "sheet-import"
        ]
      }
    },
    "/v1/customers/{customer_id}/jobs": {
      "get": {
        "operationId": "list_jobs_dashboard_v1_customers__customer_id__jobs_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Jobs Dashboard",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/v1/customers/{customer_id}/pin": {
      "delete": {
        "description": "Remove a customer's PIN. Admin-only.\n\n\"Forget about it, Jake. It's Chinatown.\" \u2014 Chinatown (about removing PINs)",
        "operationId": "remove_customer_pin_v1_customers__customer_id__pin_delete",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Customer Pin",
        "tags": [
          "pin-confirmation"
        ]
      },
      "get": {
        "description": "Check if a customer has a PIN set. Admin-only.\n\n\"Is it safe?\" \u2014 Szell, Marathon Man (about PIN status)",
        "operationId": "get_customer_pin_status_v1_customers__customer_id__pin_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Customer Pin Status",
        "tags": [
          "pin-confirmation"
        ]
      },
      "post": {
        "description": "Set a PIN for a customer. Admin-only.\n\nIf a PIN already exists, this replaces it (like a reset).\nThe customer will need to enter this PIN when executing\nskills that have PIN confirmation enabled.\n\n\"I'll make him a PIN he can't refuse.\" \u2014 Don Corleone, The Godfather",
        "operationId": "set_customer_pin_v1_customers__customer_id__pin_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Customer Pin",
        "tags": [
          "pin-confirmation"
        ]
      }
    },
    "/v1/customers/{customer_id}/shifts": {
      "get": {
        "operationId": "list_shifts_dashboard_v1_customers__customer_id__shifts_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date From"
            }
          },
          {
            "in": "query",
            "name": "date_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date To"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Shifts Dashboard",
        "tags": [
          "jobs-shifts"
        ]
      }
    },
    "/v1/customers/{customer_id}/staff": {
      "get": {
        "description": "List staff for tenant dashboard. Auth: JWT (admin only).",
        "operationId": "list_staff_dashboard_v1_customers__customer_id__staff_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skills",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Skills"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Staff Dashboard",
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/customers/{customer_id}/staff/import": {
      "post": {
        "description": "Bulk import staff for a customer. Auth: JWT (admin only).",
        "operationId": "bulk_import_staff_v1_customers__customer_id__staff_import_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffBulkCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Bulk Import Staff",
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/customers/{customer_id}/worker-bindings": {
      "get": {
        "description": "List worker-channel bindings for a customer. Auth: JWT (admin only).",
        "operationId": "tenant_list_bindings_v1_customers__customer_id__worker_bindings_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Bindings",
        "tags": [
          "worker-bindings"
        ]
      },
      "post": {
        "description": "Create a worker-channel binding. Auth: JWT (admin only).",
        "operationId": "tenant_create_binding_v1_customers__customer_id__worker_bindings_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BindingCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Create Binding",
        "tags": [
          "worker-bindings"
        ]
      }
    },
    "/v1/customers/{customer_id}/worker-bindings/{binding_id}/rebind": {
      "post": {
        "description": "Rebind a worker to a new address. Auth: JWT (admin only).",
        "operationId": "tenant_rebind_v1_customers__customer_id__worker_bindings__binding_id__rebind_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "binding_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Binding Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RebindRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Rebind",
        "tags": [
          "worker-bindings"
        ]
      }
    },
    "/v1/customers/{customer_id}/worker-bindings/{binding_id}/revoke": {
      "post": {
        "description": "Revoke a worker-channel binding. Auth: JWT (admin only).",
        "operationId": "tenant_revoke_binding_v1_customers__customer_id__worker_bindings__binding_id__revoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "binding_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Binding Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Revoke Binding",
        "tags": [
          "worker-bindings"
        ]
      }
    },
    "/v1/dashboard/chart": {
      "get": {
        "description": "Time-series chart data aggregated by day.\n\n\"Roads? Where we're going, we don't need roads.\" \u2014 Doc Brown",
        "operationId": "get_dashboard_chart_v1_dashboard_chart_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 7,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Dashboard Chart",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/onboarding": {
      "get": {
        "description": "Derive onboarding progress from existing tables. No extra state needed.\n\n\"We're adding a little something to this month's checklist.\nAs you all know, first prize is a Cadillac Eldorado.\"\n\u2014 Blake, Glengarry Glen Ross",
        "operationId": "get_onboarding_checklist_v1_dashboard_onboarding_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Onboarding Checklist",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/stats": {
      "get": {
        "description": "Aggregate dashboard stats from instances + usage_daily.\n\n\"Gentlemen, you can't fight in here! This is the War Room!\"\n\u2014 President Merkin Muffley, Dr. Strangelove",
        "operationId": "get_dashboard_stats_v1_dashboard_stats_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Dashboard Stats",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/debug-access/audit/{instance_id}": {
      "get": {
        "description": "Get the audit log for debug access on an instance.\n\n\"I'm watching you, Wazowski. Always watching.\" \u2014 Roz, Monsters Inc.",
        "operationId": "get_audit_log_v1_debug_access_audit__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Audit Log",
        "tags": [
          "debug-access"
        ]
      }
    },
    "/v1/debug-access/grant": {
      "post": {
        "description": "Grant time-windowed debug access to an instance's conversations.\n\nIf there's an existing active grant, it gets superseded (revoked).\nThe instance.consent_debug_access flag is synced for backward compat.\n\nPrivacy gate: only the customer's own owner/admin can consent to\nplatform-staff conversation access. customer_id-match is NOT enough\n\u2014 that would let any team member in the customer org override the\nowner's privacy posture.\n\n\"I'm giving you the keys to the kingdom.\" \u2014 every trusting boss ever",
        "operationId": "grant_debug_access_v1_debug_access_grant_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__debug_access__GrantOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Grant Debug Access",
        "tags": [
          "debug-access"
        ]
      }
    },
    "/v1/debug-access/presets": {
      "get": {
        "description": "Return available duration presets for the grant dialog.\n\"Choose wisely.\" \u2014 Grail Knight, Indiana Jones and the Last Crusade",
        "operationId": "get_duration_presets_v1_debug_access_presets_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "object"
                  },
                  "title": "Response Get Duration Presets V1 Debug Access Presets Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Duration Presets",
        "tags": [
          "debug-access"
        ]
      }
    },
    "/v1/debug-access/revoke/{grant_id}": {
      "post": {
        "description": "Manually revoke an active debug access grant.\n\nPrivacy gate: same boundary as grant \u2014 only customer owner/admin\ncan flip platform-staff access on or off.\n\n\"You're terminated, fucker.\" \u2014 Sarah Connor, The Terminator",
        "operationId": "revoke_debug_access_v1_debug_access_revoke__grant_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__debug_access__GrantOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Debug Access",
        "tags": [
          "debug-access"
        ]
      }
    },
    "/v1/debug-access/status/{instance_id}": {
      "get": {
        "description": "Get current debug access status for an instance.\nShows active grant (if any) and recent grant history.",
        "operationId": "get_debug_access_status_v1_debug_access_status__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DebugAccessStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Debug Access Status",
        "tags": [
          "debug-access"
        ]
      }
    },
    "/v1/demo/activate": {
      "post": {
        "description": "Switch user to demo tenant. Stores real tenant_id for restore.\n\"I feel the need... the need for speed.\" \u2014 Maverick, Top Gun",
        "operationId": "activate_demo_v1_demo_activate_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoStatusOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Activate Demo",
        "tags": [
          "demo"
        ]
      }
    },
    "/v1/demo/deactivate": {
      "post": {
        "description": "Switch user back to their real tenant.\n\"I'll be back.\" \u2014 T-800, The Terminator (to your real data)",
        "operationId": "deactivate_demo_v1_demo_deactivate_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoStatusOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Deactivate Demo",
        "tags": [
          "demo"
        ]
      }
    },
    "/v1/demo/status": {
      "get": {
        "description": "Check if user is currently in demo mode.\n\"Are you not entertained?\" \u2014 Maximus, Gladiator",
        "operationId": "get_demo_status_v1_demo_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoStatusOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Demo Status",
        "tags": [
          "demo"
        ]
      }
    },
    "/v1/domain/records": {
      "get": {
        "description": "Get the DNS records required for custom domain setup.\n\nReads the custom_domain from tenant_branding and returns\nthe CNAME/A records needed for verification.\n\n\"There's no place like home.\" \u2014 Dorothy, Wizard of Oz\n(there's no place like your custom domain)",
        "operationId": "get_domain_records_v1_domain_records_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRecordsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Domain Records",
        "tags": [
          "domains"
        ]
      }
    },
    "/v1/domain/retry-ssl": {
      "post": {
        "description": "Retry SSL provisioning for a domain stuck in error state.\n\nDeletes the old CF hostname (if any), resets state to 'none', and\nthe user can re-trigger via POST /domain/verify.\nOnly works if a custom domain is configured and ssl_status is an error state.\n\n\"Never tell me the odds.\" \u2014 Han Solo\n(about retrying failed SSL provisioning)",
        "operationId": "retry_ssl_v1_domain_retry_ssl_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Retry Ssl V1 Domain Retry Ssl Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Retry Ssl",
        "tags": [
          "domains"
        ]
      }
    },
    "/v1/domain/ssl-status": {
      "get": {
        "description": "Get current SSL automation status and recent log entries.\n\n\"Badges? We don't need no stinking badges!\" \u2014 Gold Hat, Treasure of the Sierra Madre\n(about SSL badges on the dashboard)",
        "operationId": "get_ssl_status_v1_domain_ssl_status_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SslStatusDetailOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Ssl Status",
        "tags": [
          "domains"
        ]
      }
    },
    "/v1/domain/verify": {
      "post": {
        "description": "Create CF custom hostname and start validation, or check existing status.\n\nPhase 1.10: Replaces the old DNS TXT/CNAME verification with CF API.\n- First call: creates CF custom hostname \u2192 cf_pending_validation\n- Subsequent calls: polls CF API for status update\n- CF validates via HTTP DCV when CNAME is pointed to proxy.hydracore.dev\n\n\"Trust, but verify.\" \u2014 Ronald Reagan\n(about Cloudflare hostname validation)",
        "operationId": "verify_domain_v1_domain_verify_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRecordsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Verify Domain",
        "tags": [
          "domains"
        ]
      }
    },
    "/v1/email-triggers": {
      "get": {
        "description": "Get the current tenant's email trigger configuration.\n\nReturns resolved config (defaults merged with overrides) plus\nevent metadata for the frontend to render labels.\n\n\"What we've got here is failure to communicate.\" -- Cool Hand Luke\n(not anymore -- we return everything the frontend needs)",
        "operationId": "get_email_triggers_v1_email_triggers_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Email Triggers",
        "tags": [
          "email-triggers"
        ]
      },
      "put": {
        "description": "Update the current tenant's email trigger configuration.\n\nRequires admin role. Accepts partial overrides -- unset keys keep defaults.\n\n\"I'll be back.\" -- T-800, Terminator (to toggle that trigger back on later)",
        "operationId": "update_email_triggers_v1_email_triggers_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerConfig"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Email Triggers",
        "tags": [
          "email-triggers"
        ]
      }
    },
    "/v1/email/domains": {
      "get": {
        "description": "List all custom email domains for the current tenant.\n\n\"Show me the domains!\" \u2014 Jerry Maguire (modified)",
        "operationId": "list_email_domains_v1_email_domains_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DomainOut"
                  },
                  "title": "Response List Email Domains V1 Email Domains Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Email Domains",
        "tags": [
          "email-domains"
        ]
      },
      "post": {
        "description": "Register a custom email domain via Resend.\n\nReturns DNS records that need to be configured for verification.\n\"I'll have what she's having.\" \u2014 When Harry Met Sally (about domain envy)",
        "operationId": "create_email_domain_v1_email_domains_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Email Domain",
        "tags": [
          "email-domains"
        ]
      }
    },
    "/v1/email/domains/active-sender": {
      "get": {
        "description": "Get the active From: address for this tenant's outbound emails.\n\nReturns the custom domain sender if verified and active, otherwise\nfalls back to the platform default.\n\n\"Who am I? I'm Spider-Man.\" \u2014 Peter Parker (about sender identity)",
        "operationId": "get_active_sender_v1_email_domains_active_sender_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Get Active Sender V1 Email Domains Active Sender Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Active Sender",
        "tags": [
          "email-domains"
        ]
      }
    },
    "/v1/email/domains/{domain_id}": {
      "delete": {
        "description": "Remove a custom email domain. Deletes from Resend too.\n\n\"Hasta la vista, baby.\" \u2014 T-800, Terminator 2 (about removing domains)",
        "operationId": "delete_email_domain_v1_email_domains__domain_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "domain_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Domain Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Email Domain",
        "tags": [
          "email-domains"
        ]
      },
      "patch": {
        "description": "Update from_name or from_email prefix for a domain.\n\n\"I'm not a number, I'm a free man!\" \u2014 The Prisoner\n(about customising your From: header)",
        "operationId": "update_email_domain_v1_email_domains__domain_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "domain_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Domain Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Email Domain",
        "tags": [
          "email-domains"
        ]
      }
    },
    "/v1/email/domains/{domain_id}/verify": {
      "post": {
        "description": "Trigger DNS verification check for a domain.\n\nAfter Matt configures the DNS records, he hits this to tell Resend\nto check them. Returns updated status and record statuses.\n\n\"Trust, but verify.\" \u2014 Ronald Reagan (about DNS records)",
        "operationId": "verify_email_domain_v1_email_domains__domain_id__verify_post",
        "parameters": [
          {
            "in": "path",
            "name": "domain_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Domain Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Verify Email Domain",
        "tags": [
          "email-domains"
        ]
      }
    },
    "/v1/email/inboxes": {
      "get": {
        "operationId": "list_inboxes_v1_email_inboxes_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/InboxOut"
                  },
                  "title": "Response List Inboxes V1 Email Inboxes Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Inboxes",
        "tags": [
          "email"
        ]
      },
      "post": {
        "operationId": "create_inbox_v1_email_inboxes_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboxOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Inbox",
        "tags": [
          "email"
        ]
      }
    },
    "/v1/email/inboxes/{inbox_id}": {
      "delete": {
        "operationId": "delete_inbox_v1_email_inboxes__inbox_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "inbox_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Inbox Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Inbox",
        "tags": [
          "email"
        ]
      },
      "get": {
        "operationId": "get_inbox_v1_email_inboxes__inbox_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "inbox_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Inbox Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboxOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Inbox",
        "tags": [
          "email"
        ]
      }
    },
    "/v1/email/inboxes/{inbox_id}/messages": {
      "get": {
        "operationId": "list_messages_v1_email_inboxes__inbox_id__messages_get",
        "parameters": [
          {
            "in": "path",
            "name": "inbox_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Inbox Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Direction"
            }
          },
          {
            "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Messages V1 Email Inboxes  Inbox Id  Messages Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Messages",
        "tags": [
          "email"
        ]
      }
    },
    "/v1/email/inboxes/{inbox_id}/send": {
      "post": {
        "operationId": "send_email_v1_email_inboxes__inbox_id__send_post",
        "parameters": [
          {
            "in": "path",
            "name": "inbox_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Inbox Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Send Email V1 Email Inboxes  Inbox Id  Send Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Send Email",
        "tags": [
          "email"
        ]
      }
    },
    "/v1/end-user/me": {
      "get": {
        "description": "Get the end-user's own profile.",
        "operationId": "get_my_profile_v1_end_user_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get My Profile",
        "tags": [
          "end-user-portal"
        ]
      }
    },
    "/v1/end-user/my-shifts": {
      "get": {
        "description": "Get shifts assigned to this end-user.",
        "operationId": "get_my_shifts_v1_end_user_my_shifts_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "default": "",
              "title": "Status",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get My Shifts",
        "tags": [
          "end-user-portal"
        ]
      }
    },
    "/v1/end-user/my-timesheets": {
      "get": {
        "description": "Get timesheets for this end-user.",
        "operationId": "get_my_timesheets_v1_end_user_my_timesheets_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get My Timesheets",
        "tags": [
          "end-user-portal"
        ]
      }
    },
    "/v1/end-user/my-workflows": {
      "get": {
        "description": "Get active workflow records relevant to this end-user.",
        "operationId": "get_my_workflows_v1_end_user_my_workflows_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get My Workflows",
        "tags": [
          "end-user-portal"
        ]
      }
    },
    "/v1/entity-definitions": {
      "get": {
        "operationId": "tenant_list_definitions_v1_entity_definitions_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Definitions",
        "tags": [
          "entity-store"
        ]
      },
      "post": {
        "operationId": "tenant_create_definition_v1_entity_definitions_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefinitionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Create Definition",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/v1/entity-definitions/{definition_id}": {
      "delete": {
        "operationId": "tenant_delete_definition_v1_entity_definitions__definition_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Definition Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Delete Definition",
        "tags": [
          "entity-store"
        ]
      },
      "patch": {
        "operationId": "tenant_update_definition_v1_entity_definitions__definition_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Definition Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefinitionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant Update Definition",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/v1/entity-kv": {
      "get": {
        "operationId": "tenant_list_kv_v1_entity_kv_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "namespace",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Namespace"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Kv",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/v1/entity-records": {
      "get": {
        "operationId": "tenant_list_records_v1_entity_records_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "definition_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Definition Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Records",
        "tags": [
          "entity-store"
        ]
      }
    },
    "/v1/evaluations": {
      "get": {
        "operationId": "list_evaluations_v1_evaluations_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EvaluationOut"
                  },
                  "title": "Response List Evaluations V1 Evaluations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Evaluations",
        "tags": [
          "evaluations"
        ]
      },
      "post": {
        "operationId": "create_evaluation_v1_evaluations_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Evaluation",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/evaluations/{evaluation_id}": {
      "delete": {
        "operationId": "delete_evaluation_v1_evaluations__evaluation_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Evaluation",
        "tags": [
          "evaluations"
        ]
      },
      "get": {
        "operationId": "get_evaluation_v1_evaluations__evaluation_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Evaluation",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/evaluations/{evaluation_id}/results": {
      "get": {
        "operationId": "get_results_v1_evaluations__evaluation_id__results_get",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ResultOut"
                  },
                  "title": "Response Get Results V1 Evaluations  Evaluation Id  Results Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Results",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/evaluations/{evaluation_id}/results/{result_id}": {
      "patch": {
        "operationId": "override_score_v1_evaluations__evaluation_id__results__result_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "result_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Result Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScoreOverride"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Override Score",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/evaluations/{evaluation_id}/run": {
      "post": {
        "operationId": "run_evaluation_v1_evaluations__evaluation_id__run_post",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Run Evaluation",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/evaluations/{evaluation_id}/test-cases": {
      "get": {
        "operationId": "list_test_cases_v1_evaluations__evaluation_id__test_cases_get",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TestCaseOut"
                  },
                  "title": "Response List Test Cases V1 Evaluations  Evaluation Id  Test Cases Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Test Cases",
        "tags": [
          "evaluations"
        ]
      },
      "post": {
        "operationId": "add_test_case_v1_evaluations__evaluation_id__test_cases_post",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestCaseCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestCaseOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Test Case",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/evaluations/{evaluation_id}/test-cases/{case_id}": {
      "delete": {
        "operationId": "delete_test_case_v1_evaluations__evaluation_id__test_cases__case_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Evaluation Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Test Case",
        "tags": [
          "evaluations"
        ]
      }
    },
    "/v1/forms": {
      "get": {
        "operationId": "list_forms_v1_forms_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FormOut"
                  },
                  "title": "Response List Forms V1 Forms Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Forms",
        "tags": [
          "platform-forms"
        ]
      },
      "post": {
        "operationId": "create_form_v1_forms_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Form",
        "tags": [
          "platform-forms"
        ]
      }
    },
    "/v1/forms/{form_id}": {
      "delete": {
        "operationId": "delete_form_v1_forms__form_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "form_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Form Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Form",
        "tags": [
          "platform-forms"
        ]
      },
      "get": {
        "operationId": "get_form_v1_forms__form_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "form_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Form Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Form",
        "tags": [
          "platform-forms"
        ]
      },
      "put": {
        "operationId": "update_form_v1_forms__form_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "form_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Form Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Form",
        "tags": [
          "platform-forms"
        ]
      }
    },
    "/v1/hooks/email/gmail": {
      "post": {
        "description": "Receive Gmail Pub/Sub push notification.\n\nGoogle sends: { message: { data: base64(JSON), messageId, publishTime }, subscription }\nVerified by checking the subscription matches our expected Pub/Sub subscription name.",
        "operationId": "gmail_push_webhook_v1_hooks_email_gmail_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Gmail Push Webhook",
        "tags": [
          "email-inbound"
        ]
      }
    },
    "/v1/hooks/email/resend": {
      "post": {
        "description": "Receive Resend inbound email webhook with signature verification.\n\nResend signs webhooks with a shared secret. We verify the signature\nbefore processing. See: https://resend.com/docs/webhooks",
        "operationId": "resend_inbound_webhook_v1_hooks_email_resend_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Resend Inbound Webhook",
        "tags": [
          "email-inbound"
        ]
      }
    },
    "/v1/identity-unification": {
      "get": {
        "operationId": "list_unification_rules_v1_identity_unification_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "person_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Person Id"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Unification Rules",
        "tags": [
          "identity-unification"
        ]
      },
      "post": {
        "operationId": "create_unification_rule_v1_identity_unification_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnificationRuleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Unification Rule",
        "tags": [
          "identity-unification"
        ]
      }
    },
    "/v1/identity-unification/{rule_id}": {
      "delete": {
        "operationId": "delete_unification_rule_v1_identity_unification__rule_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "rule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Unification Rule",
        "tags": [
          "identity-unification"
        ]
      }
    },
    "/v1/instances": {
      "get": {
        "operationId": "list_instances_v1_instances_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instances",
        "tags": [
          "instances"
        ]
      },
      "post": {
        "operationId": "create_instance_v1_instances_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInstanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateInstanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Instance",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/admin/{instance_id}/rotate-key": {
      "post": {
        "description": "Nullify existing API key hash, allowing /secrets to issue a fresh key.\n\nAdmin-only. Recovery path for transient /secrets failures where hash\nwas set but VPS never received the key.",
        "operationId": "rotate_agent_key_v1_instances_admin__instance_id__rotate_key_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Rotate Agent Key",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/by-key/{idempotency_key}": {
      "get": {
        "description": "Poll provisioning status by idempotency key.\n\nThe frontend fires POST /v1/instances and gets back a task_id + idempotency_key\nbut no instance_id (the Celery task creates the row asynchronously). This endpoint\nlets the deploy page poll until the instance appears, then track its status.\n\n\"Patience, young grasshopper.\" \u2014 Kung Fu (about waiting for Celery tasks)",
        "operationId": "poll_by_idempotency_key_v1_instances_by_key__idempotency_key__get",
        "parameters": [
          {
            "in": "path",
            "name": "idempotency_key",
            "required": true,
            "schema": {
              "title": "Idempotency Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionPollResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Poll By Idempotency Key",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/cleanup": {
      "post": {
        "description": "Bulk-delete all error/failed instances for the current tenant.\n\nAdmin-only. Tears down any lingering provider resources, then soft-deletes\neach instance exactly like the single-delete endpoint does (frees unique\nfields, removes child records, keeps ProvisionSnapshot for audit).\n\n\"Bring out your dead!\" \u2014 Monty Python and the Holy Grail",
        "operationId": "cleanup_dead_instances_v1_instances_cleanup_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CleanupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cleanup Dead Instances",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/fleet/runtime-rollouts/{rollout_id}/timeline": {
      "get": {
        "operationId": "get_fleet_runtime_rollout_timeline_v1_instances_fleet_runtime_rollouts__rollout_id__timeline_get",
        "parameters": [
          {
            "in": "path",
            "name": "rollout_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rollout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeRolloutTimelineOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Rollout timeline with per-target timing for visualization",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollout": {
      "post": {
        "description": "Push updated agent runtime to all running instances. Tenant admin only.",
        "operationId": "fleet_runtime_rollout_v1_instances_fleet_runtime_rollout_post",
        "parameters": [
          {
            "description": "Emergency override: bypass maintenance window. Requires tenant-wide admin flag.",
            "in": "query",
            "name": "override_window",
            "required": false,
            "schema": {
              "default": false,
              "description": "Emergency override: bypass maintenance window. Requires tenant-wide admin flag.",
              "title": "Override Window",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetRolloutResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Fleet runtime rollout",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollouts": {
      "get": {
        "operationId": "list_fleet_runtime_rollouts_v1_instances_fleet_runtime_rollouts_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RuntimeRolloutSummaryOut"
                  },
                  "title": "Response List Fleet Runtime Rollouts V1 Instances Fleet Runtime Rollouts Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List recent runtime rollout history for the tenant",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollouts/{rollout_id}": {
      "get": {
        "operationId": "get_fleet_runtime_rollout_detail_v1_instances_fleet_runtime_rollouts__rollout_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "rollout_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rollout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeRolloutDetailOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get rollout summary with per-instance targets",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollouts/{rollout_id}/cancel": {
      "post": {
        "operationId": "cancel_fleet_runtime_rollout_v1_instances_fleet_runtime_rollouts__rollout_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "rollout_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rollout Id",
              "type": "string"
            }
          },
          {
            "description": "Hard-stop: also terminate in-progress tasks via SIGTERM",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "description": "Hard-stop: also terminate in-progress tasks via SIGTERM",
              "title": "Force",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel a rollout \u2014 revoke pending targets, optionally terminate in-progress",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollouts/{rollout_id}/pause": {
      "post": {
        "operationId": "pause_fleet_runtime_rollout_v1_instances_fleet_runtime_rollouts__rollout_id__pause_post",
        "parameters": [
          {
            "in": "path",
            "name": "rollout_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rollout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Pause an in-flight rollout \u2014 revoke queued targets",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollouts/{rollout_id}/resume": {
      "post": {
        "operationId": "resume_fleet_runtime_rollout_v1_instances_fleet_runtime_rollouts__rollout_id__resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "rollout_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rollout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resume a paused rollout \u2014 re-queue cancelled targets",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/runtime/rollouts/{rollout_id}/targets/{target_id}/retry": {
      "post": {
        "operationId": "retry_fleet_runtime_rollout_target_v1_instances_fleet_runtime_rollouts__rollout_id__targets__target_id__retry_post",
        "parameters": [
          {
            "in": "path",
            "name": "rollout_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rollout Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "target_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Target Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Retry a single failed or uncertain rollout target",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/fleet/updates/policy": {
      "get": {
        "operationId": "get_tenant_update_policy_v1_instances_fleet_updates_policy_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUpdatePolicyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get tenant default update policy",
        "tags": [
          "instance-ops"
        ]
      },
      "patch": {
        "operationId": "set_tenant_update_policy_v1_instances_fleet_updates_policy_patch",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantUpdatePolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUpdatePolicyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set tenant default update policy",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}": {
      "delete": {
        "description": "Delete instance with graceful teardown.\n\nProduction-ready implementation with:\n- Authorization: customer ownership or admin role\n- Idempotency: repeated deletes return 200 with already_deleted flag\n- Async: non-blocking external calls (provider VPS + R2 artifact)\n- Race-safe: atomic state transition with FOR UPDATE lock\n- Soft-delete: preserve instance + snapshot as immutable audit trail\n\nSteps:\n1. Verify instance exists and authorize access\n2. Check idempotency (already deleted/deleting)\n3. Atomic state transition (running|failed|provisioning \u2192 deleting)\n4. Capture metadata for external cleanup (outside lock)\n5. External cleanup (provider VPS + R2 artifact) - non-blocking\n6. Database cleanup (delete related records, soft-delete instance)\n7. Free unique fields (vpn_ip, provider_instance_id, hostname)\n\nArgs:\n    instance_id: Instance UUID\n    current_user: Authenticated user from get_current_user dependency\n    db: Async database session\n\nReturns:\n    DeleteInstanceResponse with status and cleanup summary\n\nErrors:\n    401: Unauthenticated (missing/invalid X-User-Id header)\n    403: Unauthorized (instance belongs to different customer, non-admin)\n    404: Instance not found\n    500: Critical failure (partial cleanup may have occurred)",
        "operationId": "delete_instance_v1_instances__instance_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteInstanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Instance",
        "tags": [
          "instances"
        ]
      },
      "get": {
        "operationId": "get_instance_v1_instances__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/actions": {
      "get": {
        "description": "List recent actions for an instance \u2014 the activity timeline.\n\nReturns newest-first, capped at 100.\n\n\"These aren't the droids you're looking for.\" \u2014 Obi-Wan Kenobi\n(about filtering irrelevant audit entries)",
        "operationId": "list_actions_v1_instances__instance_id__actions_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Actions",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/actions/clear-circuit-breakers": {
      "post": {
        "description": "Clear all LLM provider circuit breakers on the agent.\n\nUse after a temporary provider outage resolves. Circuit breakers block\nrequests to providers that recently failed; clearing them allows retries.\n\n\"Negative, Ghost Rider, the pattern is full.\" \u2014 Air Boss Johnson, Top Gun",
        "operationId": "clear_circuit_breakers_v1_instances__instance_id__actions_clear_circuit_breakers_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Clear Circuit Breakers",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/actions/power-cycle": {
      "post": {
        "description": "Power cycle (process restart) an agent.\n\nSends exit(0) to the agent process. systemd RestartSec=2 brings it back.\nMuch faster than VPS reboot (~2s vs ~60s), fixes 80% of issues.\n\n\"Have you tried turning it off and on again?\" \u2014 Roy, The IT Crowd",
        "operationId": "power_cycle_v1_instances__instance_id__actions_power_cycle_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Power Cycle",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/actions/reboot": {
      "post": {
        "description": "VPS reboot \u2014 the nuclear option. Expect ~60 seconds downtime.\n\nOnly use when power cycle doesn't fix the issue. This reboots the entire\nserver, not just the agent process.\n\nADMIN ONLY: This is a destructive operation that takes down the entire VPS.\nRegular users should use power-cycle instead.\n\n\"Nuke it from orbit \u2014 it's the only way to be sure.\" \u2014 Ripley, Aliens",
        "operationId": "reboot_vps_v1_instances__instance_id__actions_reboot_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Reboot Vps",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/actions/run-diagnostics": {
      "post": {
        "description": "Run on-demand diagnostics \u2014 triggers a live deep health check and stores the result.\n\nThis is the \"something feels wrong, check everything\" button.\n\n\"Elementary, my dear Watson.\" \u2014 Sherlock Holmes (about diagnosing agent issues)",
        "operationId": "run_diagnostics_v1_instances__instance_id__actions_run_diagnostics_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepHealthResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Run Diagnostics",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels": {
      "get": {
        "operationId": "list_instance_channels_v1_instances__instance_id__channels_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instance Channels",
        "tags": [
          "channels"
        ]
      },
      "post": {
        "operationId": "create_channel_endpoint_v1_instances__instance_id__channels_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelEndpointCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelEndpointOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Channel Endpoint",
        "tags": [
          "channels"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/sms": {
      "delete": {
        "description": "Remove SMS channel + credentials from instance.",
        "operationId": "teardown_sms_v1_instances__instance_id__channels_sms_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Teardown Sms",
        "tags": [
          "sms-channel"
        ]
      },
      "get": {
        "description": "Get SMS channel status for an instance.",
        "operationId": "sms_status_v1_instances__instance_id__channels_sms_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Sms Status",
        "tags": [
          "sms-channel"
        ]
      },
      "post": {
        "description": "Configure SMS for an instance. Creates channel_endpoint + encrypted credentials.",
        "operationId": "setup_sms_v1_instances__instance_id__channels_sms_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SMSSetup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Setup Sms",
        "tags": [
          "sms-channel"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/telegram": {
      "delete": {
        "description": "Remove Telegram bot token and deregister webhook.\n\n\"I'll be back.\" \u2014 T-800, Terminator (about maybe re-enabling Telegram later)",
        "operationId": "remove_telegram_channel_v1_instances__instance_id__channels_telegram_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramChannelResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Telegram Channel",
        "tags": [
          "telegram-channel"
        ]
      },
      "get": {
        "description": "Get current Telegram channel configuration status.\n\nBot token is NEVER returned \u2014 only a boolean indicating whether one is stored.\n\"What we've got here is a failure to exfiltrate.\" \u2014 Captain, Cool Hand Luke (modified)",
        "operationId": "get_telegram_channel_status_v1_instances__instance_id__channels_telegram_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramChannelStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Telegram Channel Status",
        "tags": [
          "telegram-channel"
        ]
      },
      "post": {
        "description": "Configure Telegram bot token and register webhook with Telegram API.\n\nSteps:\n1. Encrypt and store bot token\n2. Generate webhook secret\n3. Call Telegram setWebhook to point at our relay\n4. Store webhook secret for verification\n\nNote: telegram_enabled is set TRUE on setup. The agent runtime is fail-closed:\ncustomer channels use customer_facing prompt if set, otherwise a safe generic prompt.\n\n\"Fasten your seatbelts, it's going to be a bumpy night.\"\n\u2014 Margo Channing, All About Eve (about Telegram webhook setup)",
        "operationId": "setup_telegram_channel_v1_instances__instance_id__channels_telegram_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramChannelSetup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramChannelResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Setup Telegram Channel",
        "tags": [
          "telegram-channel"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/voice": {
      "delete": {
        "description": "Remove voice channel + credentials.",
        "operationId": "teardown_voice_v1_instances__instance_id__channels_voice_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Teardown Voice",
        "tags": [
          "voice-channel"
        ]
      },
      "get": {
        "description": "Get voice channel status + active call count.",
        "operationId": "voice_status_v1_instances__instance_id__channels_voice_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Voice Status",
        "tags": [
          "voice-channel"
        ]
      },
      "post": {
        "description": "Configure voice channel for an instance.",
        "operationId": "setup_voice_v1_instances__instance_id__channels_voice_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSetup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Setup Voice",
        "tags": [
          "voice-channel"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/voice/calls": {
      "get": {
        "description": "List active calls for this instance.",
        "operationId": "list_active_calls_v1_instances__instance_id__channels_voice_calls_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ActiveCallOut"
                  },
                  "title": "Response List Active Calls V1 Instances  Instance Id  Channels Voice Calls Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Active Calls",
        "tags": [
          "voice-channel"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/whatsapp": {
      "delete": {
        "description": "Remove WhatsApp channel from instance.",
        "operationId": "teardown_whatsapp_v1_instances__instance_id__channels_whatsapp_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Teardown Whatsapp",
        "tags": [
          "whatsapp-channel"
        ]
      },
      "get": {
        "description": "Get WhatsApp channel status for an instance.",
        "operationId": "whatsapp_status_v1_instances__instance_id__channels_whatsapp_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Whatsapp Status",
        "tags": [
          "whatsapp-channel"
        ]
      },
      "post": {
        "description": "Configure WhatsApp for an instance. Creates channel_endpoint record.",
        "operationId": "setup_whatsapp_v1_instances__instance_id__channels_whatsapp_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsAppSetup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Setup Whatsapp",
        "tags": [
          "whatsapp-channel"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/whatsapp/connect": {
      "post": {
        "description": "Generate Meta OAuth URL for Embedded Signup.\n\nReturns the URL the frontend should redirect to. The state parameter\nis stored server-side to prevent CSRF on the callback.",
        "operationId": "initiate_embedded_signup_v1_instances__instance_id__channels_whatsapp_connect_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddedSignupInitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Initiate Embedded Signup",
        "tags": [
          "whatsapp-embedded-signup"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/whatsapp/templates": {
      "get": {
        "operationId": "list_templates_v1_instances__instance_id__channels_whatsapp_templates_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Templates",
        "tags": [
          "whatsapp-templates"
        ]
      },
      "post": {
        "operationId": "create_template_v1_instances__instance_id__channels_whatsapp_templates_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__whatsapp_templates__TemplateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__whatsapp_templates__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Template",
        "tags": [
          "whatsapp-templates"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/whatsapp/templates/{template_id}": {
      "delete": {
        "operationId": "delete_template_v1_instances__instance_id__channels_whatsapp_templates__template_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Template",
        "tags": [
          "whatsapp-templates"
        ]
      },
      "patch": {
        "operationId": "update_template_v1_instances__instance_id__channels_whatsapp_templates__template_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__whatsapp_templates__TemplateUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__whatsapp_templates__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Template",
        "tags": [
          "whatsapp-templates"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/whatsapp/templates/{template_id}/submit": {
      "post": {
        "description": "Submit a draft template to Meta for approval.\n\nCalls the Meta Graph API to create the template. Meta reviews\nasynchronously \u2014 webhook callback updates status to approved/rejected.",
        "operationId": "submit_template_v1_instances__instance_id__channels_whatsapp_templates__template_id__submit_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__whatsapp_templates__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Submit Template",
        "tags": [
          "whatsapp-templates"
        ]
      }
    },
    "/v1/instances/{instance_id}/channels/{endpoint_id}": {
      "delete": {
        "operationId": "delete_channel_endpoint_v1_instances__instance_id__channels__endpoint_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Channel Endpoint",
        "tags": [
          "channels"
        ]
      },
      "patch": {
        "operationId": "update_channel_endpoint_v1_instances__instance_id__channels__endpoint_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelEndpointUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelEndpointOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Channel Endpoint",
        "tags": [
          "channels"
        ]
      }
    },
    "/v1/instances/{instance_id}/chat": {
      "post": {
        "operationId": "proxy_chat_v1_instances__instance_id__chat_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__instances__ChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Proxy Chat",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/chat/media": {
      "post": {
        "description": "Upload a file for use in chat. Returns a media_id the chat can reference.\n\nValidates: file type, file size (5MB max).\nStores in R2 at chat-media/{tenant_id}/{instance_id}/{uuid}.{ext}",
        "operationId": "upload_chat_media_v1_instances__instance_id__chat_media_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_chat_media_v1_instances__instance_id__chat_media_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatMediaUploadResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Upload Chat Media",
        "tags": [
          "chat-media"
        ]
      }
    },
    "/v1/instances/{instance_id}/chat/media/{media_id}": {
      "get": {
        "description": "Download chat media \u2014 dashboard route (JWT auth).",
        "operationId": "download_chat_media_v1_instances__instance_id__chat_media__media_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "title": "Media Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Download Chat Media",
        "tags": [
          "chat-media"
        ]
      }
    },
    "/v1/instances/{instance_id}/config": {
      "get": {
        "operationId": "proxy_get_config_v1_instances__instance_id__config_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Proxy Get Config",
        "tags": [
          "instances"
        ]
      },
      "post": {
        "operationId": "proxy_update_config_v1_instances__instance_id__config_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Proxy Update Config",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/consent": {
      "patch": {
        "description": "Toggle conversation debug access for an instance.\n\nThe instance owner or any tenant admin can grant or revoke debug consent.\nThis controls whether the platform can read conversation content\nvia the /conversations proxy endpoints.\n\nDESIGN DECISION: Admin bypass is intentional. Platform admins need consent\nmanagement for support, compliance, and incident response. If a future\nproduct requirement mandates end-customer-only consent (no admin override),\nreplace _authorize_instance here with an owner-only check:\n    if instance.customer_id != current_user.customer_id:\n        raise HTTPException(403, \"Only the instance owner can manage consent\")\n\n\"With great power comes great responsibility.\" \u2014 Uncle Ben, Spider-Man",
        "operationId": "update_consent_v1_instances__instance_id__consent_patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentUpdateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Consent",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/conversations": {
      "get": {
        "operationId": "proxy_conversations_v1_instances__instance_id__conversations_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Proxy Conversations",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/conversations/{conversation_id}": {
      "get": {
        "operationId": "proxy_conversation_detail_v1_instances__instance_id__conversations__conversation_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "conversation_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9:_-]{1,128}$",
              "title": "Conversation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Proxy Conversation Detail",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/health/deep": {
      "get": {
        "description": "Get deep health status for an instance.\n\nReturns cached health_detail from DB by default. Pass ?force=true to\nfetch live from the agent (slower but guaranteed fresh).\n\n\"Open the pod bay doors, HAL.\" \u2014 Dave, 2001: A Space Odyssey\n(about checking if the agent is truly healthy)",
        "operationId": "get_deep_health_v1_instances__instance_id__health_deep_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "title": "Force",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepHealthResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Deep Health",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/logs": {
      "get": {
        "description": "Return provision logs for an instance, ordered by sequence.\n\n\"Game over, man! Game over!\" \u2014 Hudson, Aliens\n(about reading every step of the provisioning process)",
        "operationId": "get_instance_logs_v1_instances__instance_id__logs_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceLogsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance Logs",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/mcp-credentials": {
      "get": {
        "description": "List MCP credentials for an instance (metadata only, no plaintext).\n\nReturns the server slugs and env var KEY NAMES \u2014 never the values.\nThis is safe for the dashboard to display.\n\n\"What we've got here is failure to communicate.\" \u2014 Captain, Cool Hand Luke\n(about listing credentials without revealing them)",
        "operationId": "list_mcp_credentials_v1_instances__instance_id__mcp_credentials_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPCredentialListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Mcp Credentials",
        "tags": [
          "mcp-credentials-admin"
        ]
      }
    },
    "/v1/instances/{instance_id}/mcp-credentials/{server_slug}": {
      "delete": {
        "description": "Remove MCP server credentials for an instance.\n\n\"Forget it, Jake. It's Chinatown.\" \u2014 Walsh, Chinatown\n(about credentials that no longer exist)",
        "operationId": "delete_mcp_credentials_v1_instances__instance_id__mcp_credentials__server_slug__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "server_slug",
            "required": true,
            "schema": {
              "title": "Server Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Mcp Credentials",
        "tags": [
          "mcp-credentials-admin"
        ]
      },
      "put": {
        "description": "Set or update MCP server credentials for an instance.\n\nUpserts the credential row \u2014 if credentials already exist for this\n(instance_id, server_slug) pair, they are overwritten.\n\n\"Every time I try to get out, they pull me back in!\" \u2014 Michael Corleone\n(about updating MCP credentials)",
        "operationId": "set_mcp_credentials_v1_instances__instance_id__mcp_credentials__server_slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "server_slug",
            "required": true,
            "schema": {
              "title": "Server Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPCredentialSetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Mcp Credentials",
        "tags": [
          "mcp-credentials-admin"
        ]
      }
    },
    "/v1/instances/{instance_id}/memory": {
      "delete": {
        "operationId": "clear_instance_memory_v1_instances__instance_id__memory_delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceMemoryClearResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Clear Mnemo memories for an instance",
        "tags": [
          "instance-ops"
        ]
      },
      "get": {
        "operationId": "get_instance_memory_v1_instances__instance_id__memory_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "conversation_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Conversation Id"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceMemoryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Mnemo memories for an instance",
        "tags": [
          "instance-ops"
        ]
      },
      "post": {
        "operationId": "store_instance_memory_v1_instances__instance_id__memory_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceMemoryStoreResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Store a Mnemo fact/procedural memory for an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/model-policy": {
      "patch": {
        "description": "Update the model policy for an instance.\n\nUpdates the agent_config.model_policy in the database and optionally\npushes the change to the running VPS.\n\n\"I love the smell of napalm in the morning.\" \u2014 Lt. Col. Kilgore,\nApocalypse Now (about hot-reloading model configs)",
        "operationId": "update_model_policy_v1_instances__instance_id__model_policy_patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateModelPolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelPolicyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Model Policy",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/pin-policy": {
      "get": {
        "description": "Get the PIN policy for an instance.\n\n\"What's the frequency, Kenneth?\" \u2014 R.E.M. (about checking PIN policy)",
        "operationId": "get_pin_policy_v1_instances__instance_id__pin_policy_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinPolicyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Pin Policy",
        "tags": [
          "pin-confirmation"
        ]
      },
      "patch": {
        "description": "Update the PIN policy for an instance. Admin-only.\n\nConfigure which skills require PIN confirmation, the session TTL,\nand whether it applies to owner, customer, or all roles.\n\n\"I am altering the deal. Pray I don't alter it any further.\"\n\u2014 Darth Vader, The Empire Strikes Back (about updating PIN policies)",
        "operationId": "update_pin_policy_v1_instances__instance_id__pin_policy_patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PinPolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinPolicyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Pin Policy",
        "tags": [
          "pin-confirmation"
        ]
      }
    },
    "/v1/instances/{instance_id}/platform-config": {
      "get": {
        "description": "Read platform-level config from the instances table.\n\n\"You want answers?\" \"I want the config!\" \u2014 A Few Good Men (about JSONB)",
        "operationId": "get_platform_config_v1_instances__instance_id__platform_config_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformConfigResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Platform Config",
        "tags": [
          "instances"
        ]
      },
      "patch": {
        "description": "Merge-update platform config into agent_config JSONB.\n\nOnly fields present in the request body are updated; others are left alone.\nThis is the backend for Skills install/remove, Integrations connect/disconnect,\nChannels enable/config, and Advanced toggles.\n\n\"It's not a bug, it's a feature.\" \u2014 Every developer who just shipped a PATCH endpoint",
        "operationId": "patch_platform_config_v1_instances__instance_id__platform_config_patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPlatformConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformConfigResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Patch Platform Config",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/runtime": {
      "get": {
        "description": "Get runtime status from the VPS agent.\n\nProxies to the agent's /api/status endpoint over WireGuard.\nReturns enriched context in ALL states so the UI can show\nmeaningful progress and diagnostics \u2014 not just \"unreachable\".\n\n\"Fly, you fools!\" \u2014 Gandalf, LOTR (when the VPS is down)",
        "operationId": "get_runtime_status_v1_instances__instance_id__runtime_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Runtime Status",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/runtime/audit": {
      "get": {
        "operationId": "list_instance_runtime_audit_v1_instances__instance_id__runtime_audit_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RuntimeAuditEventOut"
                  },
                  "title": "Response List Instance Runtime Audit V1 Instances  Instance Id  Runtime Audit Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List recent runtime audit events for an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/runtime/audit/summary": {
      "get": {
        "operationId": "get_instance_runtime_audit_summary_v1_instances__instance_id__runtime_audit_summary_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeAuditSummaryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Summarize runtime audit events for an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/runtime/redeploy": {
      "post": {
        "description": "Push updated agent runtime bundle to a running instance. Admin only.",
        "operationId": "redeploy_instance_runtime_v1_instances__instance_id__runtime_redeploy_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeRedeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Redeploy agent runtime",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/runtime/rollouts": {
      "get": {
        "operationId": "list_instance_runtime_rollouts_v1_instances__instance_id__runtime_rollouts_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RuntimeRolloutTargetOut"
                  },
                  "title": "Response List Instance Runtime Rollouts V1 Instances  Instance Id  Runtime Rollouts Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List recent runtime rollout history for an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/updates/apply": {
      "post": {
        "description": "Apply pending config/skill updates to a running instance.\n\nProxies to the agent's /api/updates/apply endpoint.\n\n\"Get to the chopper!\" \u2014 Dutch, Predator (about deploying updates)",
        "operationId": "apply_updates_v1_instances__instance_id__updates_apply_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyUpdatesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplyUpdatesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Apply Updates",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/updates/apply-all": {
      "post": {
        "description": "Apply all available updates in the right order:\n1. Skills first (hot-reload, no downtime)\n2. Runtime last (requires restart)\n\nThis is the \"Update All\" button in the dashboard.\n\n\"Fire at will, Commander.\" \u2014 Picard, Star Trek TNG",
        "operationId": "apply_all_updates_v1_instances__instance_id__updates_apply_all_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplyAllUpdatesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Apply all available updates to an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/updates/available": {
      "get": {
        "description": "Compare what the agent is running against what's available.\n\nUses the version manifest stored by the fleet health loop (from\nthe agent's /api/status response). Returns a diff showing which\ncomponents have updates ready.\n\nCustomers see this as \"3 updates available\" badge on their dashboard.\nAdmins can then apply updates individually or all at once.\n\n\"You've got mail.\" \u2014 AOL (about update notifications)",
        "operationId": "check_available_updates_v1_instances__instance_id__updates_available_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableUpdatesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Check available updates for an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/updates/policy": {
      "patch": {
        "description": "Configure auto-update, notify, or disabled per component type.\n\n- **auto**: Platform automatically applies updates when available\n- **notify**: Show \"update available\" badge, customer clicks to apply\n- **disabled**: No updates, no notifications\n\n\"Would you like to know more?\" \u2014 Starship Troopers (about update notifications)",
        "operationId": "set_update_policy_v1_instances__instance_id__updates_policy_patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePolicyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set update policy for an instance",
        "tags": [
          "instance-ops"
        ]
      }
    },
    "/v1/instances/{instance_id}/usage": {
      "get": {
        "description": "Usage breakdown for a single instance with daily time series.\n\n\"Every time a bell rings, an angel gets its wings.\"\n\u2014 Clarence, It's a Wonderful Life (about every token getting counted)",
        "operationId": "get_instance_usage_v1_instances__instance_id__usage_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__instances__InstanceUsageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance Usage",
        "tags": [
          "instances"
        ]
      }
    },
    "/v1/instances/{instance_id}/website": {
      "get": {
        "description": "Get the website configuration for a specific instance.\n\nReturns a fresh draft if no config exists yet for this instance.\n\"Houston, we have a problem.\" \u2014 Apollo 13 (when website config is missing)",
        "operationId": "get_instance_website_config_v1_instances__instance_id__website_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebsiteConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance Website Config",
        "tags": [
          "websites"
        ]
      },
      "put": {
        "description": "Update the website configuration for a specific instance.\n\nAdmin only. Partial update \u2014 only provided fields are changed.\n\"Make it so.\" \u2014 Captain Picard (about deploying website config changes)",
        "operationId": "update_instance_website_config_v1_instances__instance_id__website_put",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebsiteConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebsiteConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Instance Website Config",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/instances/{instance_id}/website/deploy": {
      "post": {
        "description": "Re-deploy the website for this specific instance.\n\nPushes updated website assets to the EXISTING running instance.\nDoes NOT create a new server \u2014 that's what the tenant-scoped deploy\nendpoint does (via provision_instance).\n\n\"Gentlemen, you can't fight in here! This is the War Room!\"\n\u2014 President Merkin Muffley, Dr. Strangelove (about deploying websites)",
        "operationId": "deploy_instance_website_v1_instances__instance_id__website_deploy_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__websites__DeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Deploy Instance Website",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/instances/{instance_id}/website/history": {
      "get": {
        "operationId": "get_instance_website_history_v1_instances__instance_id__website_history_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebsiteHistoryOut"
                  },
                  "title": "Response Get Instance Website History V1 Instances  Instance Id  Website History Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance Website History",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/instances/{instance_id}/website/preview": {
      "get": {
        "description": "Preview the website config for a specific instance.\n\n\"Frankly, my dear, I don't give a damn.\" \u2014 Rhett Butler\n(about rendering previews without deploying)",
        "operationId": "preview_instance_website_v1_instances__instance_id__website_preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Preview Instance Website",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/instances/{instance_id}/website/rollback": {
      "post": {
        "operationId": "rollback_instance_website_v1_instances__instance_id__website_rollback_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebsiteRollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__websites__DeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Rollback Instance Website",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/instances/{instance_id}/website/upload": {
      "post": {
        "description": "Upload a custom website archive for this instance.\n\nUploads are tenant-shared \u2014 this is a convenience route that verifies\ninstance ownership then delegates to the tenant-scoped upload logic.\n\n\"I love the smell of napalm in the morning.\" \u2014 Lt. Col. Kilgore\n(about freshly uploaded website archives)",
        "operationId": "upload_instance_custom_site_v1_instances__instance_id__website_upload_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_instance_custom_site_v1_instances__instance_id__website_upload_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Upload Instance Custom Site",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/instances/{instance_id}/website/uploads": {
      "get": {
        "description": "List tenant's custom site uploads (shared across instances).\n\n\"We're on a mission from God.\" \u2014 Elwood Blues, The Blues Brothers",
        "operationId": "list_instance_uploads_v1_instances__instance_id__website_uploads_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UploadOut"
                  },
                  "title": "Response List Instance Uploads V1 Instances  Instance Id  Website Uploads Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instance Uploads",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "operationId": "tenant_list_invoices_v1_invoices_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Invoices",
        "tags": [
          "finance"
        ]
      }
    },
    "/v1/knowledge/ingest": {
      "post": {
        "description": "Ingest text content into knowledge base.",
        "operationId": "ingest_text_admin_v1_knowledge_ingest_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestTextRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Ingest Text Admin",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/v1/knowledge/sources": {
      "get": {
        "description": "List knowledge sources with chunk counts.",
        "operationId": "list_sources_v1_knowledge_sources_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SourceOut"
                  },
                  "title": "Response List Sources V1 Knowledge Sources Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Sources",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/v1/knowledge/sources/{source_id}": {
      "delete": {
        "description": "Delete chunks for a knowledge source, scoped by customer/instance.\n\nMatches the same 4-tuple scoping as re-ingest:\n- tenant_id + source_type + source_id + customer_id + instance_id\n- NULL dimensions match only NULL (not all).",
        "operationId": "delete_source_v1_knowledge_sources__source_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "source_id",
            "required": true,
            "schema": {
              "title": "Source Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source_type",
            "required": false,
            "schema": {
              "default": "r2",
              "title": "Source Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Instance Id"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Delete Source V1 Knowledge Sources  Source Id  Delete",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Source",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/v1/logs": {
      "get": {
        "operationId": "list_logs_v1_logs_get",
        "parameters": [
          {
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Instance Id"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "event_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "in": "query",
            "name": "severity",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Severity"
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Logs",
        "tags": [
          "logs"
        ]
      }
    },
    "/v1/marketplace/admin/publishers/{publisher_id}/approve": {
      "put": {
        "description": "Approve a publisher application (admin only).\n\n\"You shall not pass!\" \u2014 Gandalf (unless you're approved)",
        "operationId": "approve_publisher_v1_marketplace_admin_publishers__publisher_id__approve_put",
        "parameters": [
          {
            "in": "path",
            "name": "publisher_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Publisher Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublisherOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Approve Publisher",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/admin/skills/{skill_id}/approve": {
      "put": {
        "description": "Approve a submitted skill (admin only).\n\n\"I'm the captain now.\" \u2014 Muse, Captain Phillips (about marketplace moderation)",
        "operationId": "approve_skill_v1_marketplace_admin_skills__skill_id__approve_put",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__marketplace__SkillOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Approve Skill",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/admin/skills/{skill_id}/reject": {
      "put": {
        "description": "Reject a submitted skill (admin only).",
        "operationId": "reject_skill_v1_marketplace_admin_skills__skill_id__reject_put",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "description": "Rejection reason",
            "in": "query",
            "name": "reason",
            "required": false,
            "schema": {
              "default": "",
              "description": "Rejection reason",
              "title": "Reason",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Reject Skill",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/categories": {
      "get": {
        "description": "List all skill categories with counts.\n\n\"There's no place like home.\" \u2014 Dorothy, Wizard of Oz (about category filtering)",
        "operationId": "list_categories_v1_marketplace_categories_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "object"
                  },
                  "title": "Response List Categories V1 Marketplace Categories Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Categories",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/instances/{instance_id}/skills": {
      "get": {
        "description": "List skills installed on an instance.",
        "operationId": "list_instance_skills_v1_marketplace_instances__instance_id__skills_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/InstanceSkillOut"
                  },
                  "title": "Response List Instance Skills V1 Marketplace Instances  Instance Id  Skills Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instance Skills",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/instances/{instance_id}/skills/install": {
      "post": {
        "description": "One-click install a marketplace skill on an instance.\n\n\"Get to the chopper!\" \u2014 Dutch, Predator (about installing skills quickly)",
        "operationId": "install_skill_v1_marketplace_instances__instance_id__skills_install_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillInstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceSkillOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Install Skill",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/instances/{instance_id}/skills/{skill_id}": {
      "delete": {
        "description": "Remove a marketplace skill from an instance.\n\n\"Hasta la vista, baby.\" \u2014 T-800, Terminator 2 (about skill removal)",
        "operationId": "uninstall_skill_v1_marketplace_instances__instance_id__skills__skill_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Uninstall Skill",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/publishers": {
      "post": {
        "description": "Register as a marketplace publisher.\n\n\"Listen very carefully, I shall say this only once.\"\n\u2014 Michelle, 'Allo 'Allo! (about publisher registration)",
        "operationId": "create_publisher_v1_marketplace_publishers_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublisherCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublisherOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Publisher",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/publishers/me": {
      "get": {
        "description": "Get the current user's publisher profile (if any).",
        "operationId": "get_my_publisher_v1_marketplace_publishers_me_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PublisherOut"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Get My Publisher V1 Marketplace Publishers Me Get"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get My Publisher",
        "tags": [
          "marketplace"
        ]
      },
      "put": {
        "description": "Update publisher profile.",
        "operationId": "update_my_publisher_v1_marketplace_publishers_me_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublisherUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublisherOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update My Publisher",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/publishers/{slug}": {
      "get": {
        "description": "Get a public publisher profile by slug.\n\n\"You talking to me?\" \u2014 Travis Bickle, Taxi Driver (about publisher slugs)",
        "operationId": "get_publisher_v1_marketplace_publishers__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublisherOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Publisher",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/reseller/pricing": {
      "get": {
        "description": "List reseller pricing overrides for the current tenant.\n\n\"Show me the money!\" \u2014 Jerry Maguire",
        "operationId": "list_reseller_pricing_v1_marketplace_reseller_pricing_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ResellerPricingOut"
                  },
                  "title": "Response List Reseller Pricing V1 Marketplace Reseller Pricing Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Reseller Pricing",
        "tags": [
          "marketplace"
        ]
      },
      "put": {
        "description": "Set reseller markup for a specific skill.\n\n\"Greed, for lack of a better word, is good.\"\n\u2014 Gordon Gekko, Wall Street (about markup configuration)",
        "operationId": "set_reseller_pricing_v1_marketplace_reseller_pricing_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResellerPricingSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerPricingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Reseller Pricing",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/reseller/pricing/{skill_id}": {
      "delete": {
        "description": "Remove reseller pricing override, reverting to publisher's price.",
        "operationId": "delete_reseller_pricing_v1_marketplace_reseller_pricing__skill_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Reseller Pricing",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/skills": {
      "get": {
        "description": "Browse approved marketplace skills.\n\n\"I see dead skills.\" \u2014 Cole Sear, The Sixth Sense (about deprecated ones)",
        "operationId": "discover_skills_v1_marketplace_skills_get",
        "parameters": [
          {
            "description": "Filter by category",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category",
              "title": "Category"
            }
          },
          {
            "description": "Filter: skill, mcp_server",
            "in": "query",
            "name": "item_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter: skill, mcp_server",
              "title": "Item Type"
            }
          },
          {
            "description": "Search name/description/tags",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search name/description/tags",
              "title": "Search"
            }
          },
          {
            "description": "Filter: free, one_time, monthly, yearly",
            "in": "query",
            "name": "billing_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter: free, one_time, monthly, yearly",
              "title": "Billing Type"
            }
          },
          {
            "description": "Filter featured only",
            "in": "query",
            "name": "featured",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter featured only",
              "title": "Featured"
            }
          },
          {
            "description": "Sort: popular, newest, price_asc, price_desc",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "popular",
              "description": "Sort: popular, newest, price_asc, price_desc",
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__marketplace__SkillOut"
                  },
                  "title": "Response Discover Skills V1 Marketplace Skills Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Discover Skills",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/skills/mine": {
      "get": {
        "description": "List skills belonging to the current publisher.",
        "operationId": "list_my_skills_v1_marketplace_skills_mine_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__marketplace__SkillOut"
                  },
                  "title": "Response List My Skills V1 Marketplace Skills Mine Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List My Skills",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/skills/submit": {
      "post": {
        "description": "Submit a new skill to the marketplace.\n\n\"If you build it, they will come.\" \u2014 Shoeless Joe, Field of Dreams",
        "operationId": "submit_skill_v1_marketplace_skills_submit_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillSubmit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__marketplace__SkillOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Submit Skill",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/skills/{skill_id}": {
      "get": {
        "description": "Get a single marketplace skill by ID. Public catalog \u2014 only\napproved skills are exposed. Submitted/draft/rejected skills must\nuse the publisher-owned views (`/skills/mine` or\n`_get_owned_skill`).",
        "operationId": "get_skill_v1_marketplace_skills__skill_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__marketplace__SkillOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Skill",
        "tags": [
          "marketplace"
        ]
      },
      "put": {
        "description": "Update a skill you own.",
        "operationId": "update_skill_v1_marketplace_skills__skill_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__marketplace__SkillOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Skill",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/marketplace/skills/{skill_id}/versions": {
      "get": {
        "description": "List published versions of a skill. Public catalog \u2014 parent\nskill must be approved, otherwise versions for a private/submitted\nskill would leak to anyone who knows the skill ID.",
        "operationId": "list_skill_versions_v1_marketplace_skills__skill_id__versions_get",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillVersionOut"
                  },
                  "title": "Response List Skill Versions V1 Marketplace Skills  Skill Id  Versions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skill Versions",
        "tags": [
          "marketplace"
        ]
      },
      "post": {
        "description": "Publish a new version of a skill.\n\n\"Sequel? We're doing a sequel?\" \u2014 Every 80s action hero",
        "operationId": "create_skill_version_v1_marketplace_skills__skill_id__versions_post",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "required": true,
            "schema": {
              "maxLength": 30,
              "minLength": 1,
              "title": "Version",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "changelog",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Changelog"
            }
          },
          {
            "description": "Pre-computed composite SHA-256 for non-builtin skills.",
            "in": "query",
            "name": "bundle_hash",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pre-computed composite SHA-256 for non-builtin skills.",
              "title": "Bundle Hash"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillVersionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Skill Version",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/v1/mcp/api-key-context": {
      "get": {
        "description": "Return bounded metadata about the calling API key.\n\nUsed by the HydraCore MCP server at startup to populate its\nlocal scope-filtering state. JWT callers receive 401 because\nthe endpoint requires X-Api-Key by construction.\n\nNo cross-key information leaks: the response describes ONLY\nthe key making this request (read from `request.state` after\n`get_current_user_from_api_key` has stamped it).",
        "operationId": "get_api_key_context_v1_mcp_api_key_context_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyContextResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Api Key Context",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/mcp/audit-log": {
      "post": {
        "description": "Persist one MCP call_tool invocation to `mcp_call_log`.\n\nServer-stamped from `request.state` (after auth):\n  - id       (uuid4)\n  - ts       (now())\n  - scope_kind = 'api_key' (only path that reaches here today)\n  - api_key_id, user_id, tenant_id, customer_id\n\nBody-controlled (validated by Pydantic + DB CHECK):\n  - tool_name, scope_tag, status, http_status, latency_ms,\n    error_class, request_id\n\nReturns 204 No Content. The MCP emit hook is fire-and-forget;\nthe body is never read.",
        "operationId": "emit_mcp_call_log_v1_mcp_audit_log_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPCallLogIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Emit Mcp Call Log",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/me/pin": {
      "get": {
        "description": "Check if the current authenticated user has a PIN set.\n\nUsed by the frontend Security section \u2014 no customer_id needed,\njust uses the JWT context. \"Who am I? I'm the guy with the PIN.\"\n\u2014 Frank Castle, if he used fintech apps",
        "operationId": "get_my_pin_status_v1_me_pin_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PinStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get My Pin Status",
        "tags": [
          "pin-confirmation"
        ]
      }
    },
    "/v1/metrics/instances": {
      "get": {
        "description": "Per-instance usage breakdown \u2014 which agents are earning their keep.\n\n\"I'm too old for this shit.\" \u2014 Roger Murtaugh, Lethal Weapon\n(about agents that aren't pulling their weight)",
        "operationId": "get_instance_usage_v1_metrics_instances_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 7,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__metrics__InstanceUsageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance Usage",
        "tags": [
          "metrics"
        ]
      }
    },
    "/v1/metrics/models": {
      "get": {
        "description": "Per-model usage breakdown \u2014 sorted by request count desc.\n\n\"Say hello to my little friend!\" \u2014 Tony Montana, Scarface\n(introducing your most-used model)",
        "operationId": "get_model_breakdown_v1_metrics_models_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 7,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelBreakdownOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Model Breakdown",
        "tags": [
          "metrics"
        ]
      }
    },
    "/v1/metrics/summary": {
      "get": {
        "description": "Aggregate usage summary for the selected period.\n\n\"That's a lot of nuts!\" \u2014 Chosen One, Kung Pow",
        "operationId": "get_metrics_summary_v1_metrics_summary_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 7,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsSummaryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Metrics Summary",
        "tags": [
          "metrics"
        ]
      }
    },
    "/v1/metrics/usage": {
      "get": {
        "description": "Daily token usage time-series with zero-fill.\n\n\"Life is like a box of chocolates.\" \u2014 Forrest Gump\n(and every day is a data point)",
        "operationId": "get_usage_timeseries_v1_metrics_usage_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 7,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageTimeSeriesOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Usage Timeseries",
        "tags": [
          "metrics"
        ]
      }
    },
    "/v1/model-catalog": {
      "get": {
        "operationId": "list_models_admin_v1_model_catalog_get",
        "parameters": [
          {
            "in": "query",
            "name": "modality",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Modality"
            }
          },
          {
            "in": "query",
            "name": "include_deprecated",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Deprecated",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ModelCatalogOut"
                  },
                  "title": "Response List Models Admin V1 Model Catalog Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Models Admin",
        "tags": [
          "model-catalog"
        ]
      },
      "post": {
        "operationId": "create_model_v1_model_catalog_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelCatalogCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCatalogOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Model",
        "tags": [
          "model-catalog"
        ]
      }
    },
    "/v1/model-catalog/{slug}": {
      "get": {
        "operationId": "get_model_admin_v1_model_catalog__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCatalogOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Model Admin",
        "tags": [
          "model-catalog"
        ]
      },
      "patch": {
        "operationId": "update_model_v1_model_catalog__slug__patch",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelCatalogUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCatalogOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Model",
        "tags": [
          "model-catalog"
        ]
      }
    },
    "/v1/model-overrides": {
      "get": {
        "operationId": "list_model_overrides_v1_model_overrides_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ModelOverrideOut"
                  },
                  "title": "Response List Model Overrides V1 Model Overrides Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Model Overrides",
        "tags": [
          "model-overrides"
        ]
      },
      "post": {
        "operationId": "create_model_override_v1_model_overrides_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelOverrideCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelOverrideOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Model Override",
        "tags": [
          "model-overrides"
        ]
      }
    },
    "/v1/model-overrides/resolve/{customer_id}": {
      "get": {
        "description": "Resolve the effective model policy for a customer.\n\nMerges: platform defaults < tenant override < customer override.\nInstance-level config (model_policy) takes final precedence at runtime.\nAdmin-only \u2014 exposes budget and model policy config.",
        "operationId": "resolve_model_policy_v1_model_overrides_resolve__customer_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedModelPolicy"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resolve Model Policy",
        "tags": [
          "model-overrides"
        ]
      }
    },
    "/v1/model-overrides/{override_id}": {
      "delete": {
        "operationId": "delete_model_override_v1_model_overrides__override_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "override_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Override Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Model Override",
        "tags": [
          "model-overrides"
        ]
      },
      "put": {
        "operationId": "update_model_override_v1_model_overrides__override_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "override_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Override Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelOverrideCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelOverrideOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Model Override",
        "tags": [
          "model-overrides"
        ]
      }
    },
    "/v1/models/availability": {
      "get": {
        "description": "Report which providers the runtime can actually use for this tenant.\n\nMatches the resolution hierarchy in model_catalog._resolve_api_key:\ntenant-level InstanceMCPCredential OR platform env var. The per-instance\noverride tier is intentionally excluded from this tenant-wide view\n(it's a runtime detail, not a recipe-design concern).",
        "operationId": "model_availability_v1_models_availability_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelAvailabilityResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Model Availability",
        "tags": [
          "models"
        ]
      }
    },
    "/v1/models/tiers": {
      "get": {
        "description": "List the platform-managed model tiers.\n\nThese are served without tenant BYOK context \u2014 the tenant can pick a tier\nand the platform picks the model, OR (if BYOK available) override at recipe\nlevel via model_policy.primary.",
        "operationId": "list_tiers_v1_models_tiers_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TiersResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Tiers",
        "tags": [
          "models"
        ]
      }
    },
    "/v1/oauth/google/callback": {
      "get": {
        "description": "Handle Google OAuth callback. Exchanges code for tokens, stores connections.",
        "operationId": "google_oauth_callback_v1_oauth_google_callback_get",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "title": "Code",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "title": "State",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": false,
            "schema": {
              "title": "Error",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleOAuthCompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Google Oauth Callback",
        "tags": [
          "google-oauth"
        ]
      }
    },
    "/v1/oauth/google/init": {
      "post": {
        "description": "Generate Google OAuth URL. Auth: JWT or API-key (tenant admin).",
        "operationId": "initiate_google_oauth_v1_oauth_google_init_post",
        "parameters": [
          {
            "description": "Customer to connect Google for",
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "description": "Customer to connect Google for",
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleOAuthInitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Initiate Google Oauth",
        "tags": [
          "google-oauth"
        ]
      }
    },
    "/v1/oauth/microsoft/authorize": {
      "post": {
        "description": "Generate Microsoft OAuth URL. Auth: JWT or API-key (tenant admin).",
        "operationId": "initiate_microsoft_oauth_v1_oauth_microsoft_authorize_post",
        "parameters": [
          {
            "description": "Customer to connect Microsoft for",
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "description": "Customer to connect Microsoft for",
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicrosoftOAuthInitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Initiate Microsoft Oauth",
        "tags": [
          "microsoft-oauth"
        ]
      }
    },
    "/v1/oauth/microsoft/callback": {
      "get": {
        "description": "Handle Microsoft OAuth callback. Exchanges code for tokens, stores connections.",
        "operationId": "microsoft_oauth_callback_v1_oauth_microsoft_callback_get",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "title": "Code",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "title": "State",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": false,
            "schema": {
              "title": "Error",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error_description",
            "required": false,
            "schema": {
              "title": "Error Description",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicrosoftOAuthCompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Microsoft Oauth Callback",
        "tags": [
          "microsoft-oauth"
        ]
      }
    },
    "/v1/onboarding-flows": {
      "get": {
        "operationId": "list_flows_v1_onboarding_flows_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FlowOut"
                  },
                  "title": "Response List Flows V1 Onboarding Flows Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Flows",
        "tags": [
          "onboarding-flows"
        ]
      },
      "post": {
        "operationId": "create_flow_v1_onboarding_flows_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Flow",
        "tags": [
          "onboarding-flows"
        ]
      }
    },
    "/v1/onboarding-flows/{flow_id}": {
      "delete": {
        "operationId": "delete_flow_v1_onboarding_flows__flow_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "flow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Flow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Flow",
        "tags": [
          "onboarding-flows"
        ]
      },
      "get": {
        "operationId": "get_flow_v1_onboarding_flows__flow_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "flow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Flow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Flow",
        "tags": [
          "onboarding-flows"
        ]
      },
      "put": {
        "operationId": "update_flow_v1_onboarding_flows__flow_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "flow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Flow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Flow",
        "tags": [
          "onboarding-flows"
        ]
      }
    },
    "/v1/onboarding-instances": {
      "get": {
        "operationId": "list_instances_v1_onboarding_instances_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Instances V1 Onboarding Instances Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instances",
        "tags": [
          "onboarding-instances"
        ]
      }
    },
    "/v1/onboarding/complete": {
      "post": {
        "description": "Mark onboarding as done. Called when user finishes the wizard.\n\nRequires account admin: completion flips org-wide state and setup\nrequires admin, so completion can't be weaker.\n\n\"That'll do, pig. That'll do.\" \u2014 Farmer Hoggett, Babe",
        "operationId": "complete_onboarding_v1_onboarding_complete_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingCompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Complete Onboarding",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/setup": {
      "post": {
        "description": "Save organisation details (step 1 of onboarding).\n\nRequires account admin (owner or admin team role).",
        "operationId": "setup_organisation_v1_onboarding_setup_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingSetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Setup Organisation",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/status": {
      "get": {
        "description": "Check whether the current user has completed onboarding.\n\n\"Are we there yet?\" \u2014 Every backseat passenger ever",
        "operationId": "get_onboarding_status_v1_onboarding_status_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Onboarding Status",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/plugins/apps": {
      "get": {
        "operationId": "list_plugin_apps_v1_plugins_apps_get",
        "parameters": [
          {
            "description": "Filter by provider slug",
            "in": "query",
            "name": "provider_slug",
            "required": false,
            "schema": {
              "description": "Filter by provider slug",
              "title": "Provider Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AppOut"
                  },
                  "title": "Response List Plugin Apps V1 Plugins Apps Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Plugin Apps",
        "tags": [
          "plugins"
        ]
      }
    },
    "/v1/plugins/apps/{app_name}/tools": {
      "get": {
        "operationId": "list_plugin_tools_v1_plugins_apps__app_name__tools_get",
        "parameters": [
          {
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "title": "App Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "provider_slug",
            "required": false,
            "schema": {
              "title": "Provider Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PluginToolOut"
                  },
                  "title": "Response List Plugin Tools V1 Plugins Apps  App Name  Tools Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Plugin Tools",
        "tags": [
          "plugins"
        ]
      }
    },
    "/v1/plugins/connect": {
      "post": {
        "operationId": "initiate_plugin_connect_v1_plugins_connect_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Initiate Plugin Connect",
        "tags": [
          "plugins"
        ]
      }
    },
    "/v1/plugins/connections": {
      "get": {
        "operationId": "list_plugin_connections_v1_plugins_connections_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PluginConnectionOut"
                  },
                  "title": "Response List Plugin Connections V1 Plugins Connections Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Plugin Connections",
        "tags": [
          "plugins"
        ]
      }
    },
    "/v1/plugins/connections/{connection_id}": {
      "delete": {
        "operationId": "delete_plugin_connection_v1_plugins_connections__connection_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Plugin Connection",
        "tags": [
          "plugins"
        ]
      }
    },
    "/v1/plugins/providers": {
      "get": {
        "operationId": "list_plugin_providers_v1_plugins_providers_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__plugins__ProviderOut"
                  },
                  "title": "Response List Plugin Providers V1 Plugins Providers Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Plugin Providers",
        "tags": [
          "plugins"
        ]
      }
    },
    "/v1/portal/chat": {
      "post": {
        "operationId": "portal_chat_v1_portal_chat_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Portal Chat",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/me": {
      "get": {
        "operationId": "get_my_profile_v1_portal_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfileOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get My Profile",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/media/upload-url": {
      "post": {
        "description": "Get a presigned upload URL for portal media.",
        "operationId": "portal_media_upload_url_v1_portal_media_upload_url_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Portal Media Upload Url V1 Portal Media Upload Url Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Portal Media Upload Url",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/media/{media_id}/confirm": {
      "post": {
        "description": "Confirm a media upload completed successfully.\n\nCalled by the frontend after the R2 PUT succeeds. Moves the\nWebsiteMedia row from 'pending' to 'confirmed' so it appears\nin media listings.",
        "operationId": "portal_media_confirm_upload_v1_portal_media__media_id__confirm_post",
        "parameters": [
          {
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Media Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Portal Media Confirm Upload V1 Portal Media  Media Id  Confirm Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Portal Media Confirm Upload",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites": {
      "get": {
        "description": "List all websites owned by the authenticated customer.",
        "operationId": "list_my_sites_v1_portal_sites_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PortalSiteOut"
                  },
                  "title": "Response List My Sites V1 Portal Sites Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List My Sites",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites/{config_id}/analytics": {
      "get": {
        "description": "Analytics summary for a customer's site.",
        "operationId": "get_site_analytics_v1_portal_sites__config_id__analytics_get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "default": 7,
              "title": "Period",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalAnalyticsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Site Analytics",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites/{config_id}/forms": {
      "get": {
        "description": "Form submissions for a customer's site.",
        "operationId": "list_site_forms_v1_portal_sites__config_id__forms_get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unread_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Unread Only",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PortalFormOut"
                  },
                  "title": "Response List Site Forms V1 Portal Sites  Config Id  Forms Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Site Forms",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites/{config_id}/pages": {
      "get": {
        "operationId": "list_site_pages_v1_portal_sites__config_id__pages_get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PortalPageOut"
                  },
                  "title": "Response List Site Pages V1 Portal Sites  Config Id  Pages Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Site Pages",
        "tags": [
          "portal"
        ]
      },
      "post": {
        "operationId": "create_page_v1_portal_sites__config_id__pages_post",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalPageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Page",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites/{config_id}/pages/{slug}": {
      "delete": {
        "operationId": "delete_page_v1_portal_sites__config_id__pages__slug__delete",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Page",
        "tags": [
          "portal"
        ]
      },
      "put": {
        "operationId": "update_page_v1_portal_sites__config_id__pages__slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalPageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Page",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites/{config_id}/submissions": {
      "get": {
        "operationId": "list_submissions_v1_portal_sites__config_id__submissions_get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "unread_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Unread Only",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PortalFormOut"
                  },
                  "title": "Response List Submissions V1 Portal Sites  Config Id  Submissions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Submissions",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/portal/sites/{config_id}/submissions/{submission_id}": {
      "patch": {
        "operationId": "update_submission_v1_portal_sites__config_id__submissions__submission_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "submission_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Submission Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmissionPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Update Submission V1 Portal Sites  Config Id  Submissions  Submission Id  Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Submission",
        "tags": [
          "portal"
        ]
      }
    },
    "/v1/presets/catalog": {
      "get": {
        "description": "Return all built-in platform presets available in the deploy wizard.\n\nTenant-created recipes are served separately via /v1/recipes; the deploy\nwizard merges the two lists.",
        "operationId": "list_preset_catalog_v1_presets_catalog_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetCatalogResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Preset Catalog",
        "tags": [
          "presets"
        ]
      }
    },
    "/v1/providers": {
      "get": {
        "description": "List all available LLM providers with model catalogs.\n\nIncludes `has_key` flag indicating whether the tenant has stored a key.\n\n\"I'm gonna make him an offer he can't refuse.\" \u2014 Don Corleone, The Godfather\n(about our provider pricing)",
        "operationId": "list_providers_v1_providers_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__providers__ProviderOut"
                  },
                  "title": "Response List Providers V1 Providers Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Providers",
        "tags": [
          "providers"
        ]
      }
    },
    "/v1/providers/keys": {
      "get": {
        "description": "List stored API keys (metadata only \u2014 never returns plaintext).\n\n\"I see nothing! NOTHING!\" \u2014 Sgt. Schultz, Hogan's Heroes",
        "operationId": "list_stored_keys_v1_providers_keys_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/StoredKeyOut"
                  },
                  "title": "Response List Stored Keys V1 Providers Keys Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Stored Keys",
        "tags": [
          "providers"
        ]
      },
      "post": {
        "description": "Store an encrypted API key for a provider (upsert \u2014 replaces existing).\n\n\"After all, tomorrow is another day!\" \u2014 Scarlett O'Hara, Gone with the Wind\n(about rotating API keys)",
        "operationId": "store_key_v1_providers_keys_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Store Key",
        "tags": [
          "providers"
        ]
      }
    },
    "/v1/providers/keys/{provider_id}": {
      "delete": {
        "description": "Delete stored API key for a provider.\n\n\"Hasta la vista, baby.\" \u2014 T-800, Terminator 2",
        "operationId": "delete_key_v1_providers_keys__provider_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "provider_id",
            "required": true,
            "schema": {
              "title": "Provider Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Key",
        "tags": [
          "providers"
        ]
      }
    },
    "/v1/providers/validate": {
      "post": {
        "description": "Validate an API key against a provider (lightweight check).\n\nPerforms a minimal API call (e.g. list models) to verify the key works.\nRate-limited to prevent abuse.\n\n\"Do you feel lucky? Well, do ya, punk?\" \u2014 Harry Callahan, Dirty Harry",
        "operationId": "validate_key_v1_providers_validate_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Validate Key",
        "tags": [
          "providers"
        ]
      }
    },
    "/v1/public/analytics/track": {
      "post": {
        "description": "Record a page view event from a published website.\n\nRate-limited to 100 events per minute per IP.\nsite_id is the public tracking_token (resolved to hosted_website_id server-side).",
        "operationId": "track_analytics_v1_public_analytics_track_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsTrackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Track Analytics",
        "tags": [
          "public"
        ]
      }
    },
    "/v1/public/forms/submit": {
      "post": {
        "description": "Accept a form submission from a published website.\n\nRate-limited to 5 submissions per minute per IP.\nsite_id is the website_config_id (canonical external identity).",
        "operationId": "submit_form_v1_public_forms_submit_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormSubmitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormSubmitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Form",
        "tags": [
          "public"
        ]
      }
    },
    "/v1/public/forms/{form_slug}": {
      "get": {
        "description": "Get form definition + any existing draft for the token's respondent.\n\nThis is what the form renderer calls on load.\nReturns form config (fields, settings) + draft answers if resuming.",
        "operationId": "get_form_public_v1_public_forms__form_slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "form_slug",
            "required": true,
            "schema": {
              "title": "Form Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Form Public",
        "tags": [
          "platform-forms-public"
        ]
      }
    },
    "/v1/public/forms/{form_slug}/draft": {
      "patch": {
        "description": "Save partial form progress (auto-save on field completion).\n\nWorkers on mobile get interrupted \u2014 this lets them resume from the same link.",
        "operationId": "save_draft_v1_public_forms__form_slug__draft_patch",
        "parameters": [
          {
            "in": "path",
            "name": "form_slug",
            "required": true,
            "schema": {
              "title": "Form Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Save Draft",
        "tags": [
          "platform-forms-public"
        ]
      }
    },
    "/v1/public/forms/{form_slug}/submit": {
      "post": {
        "description": "Submit a completed form. Creates an entity record if linked to a definition.\n\nIdempotent: concurrent submits are serialised via FOR UPDATE row lock.\nAlready-completed submissions return the existing result.",
        "operationId": "submit_form_v1_public_forms__form_slug__submit_post",
        "parameters": [
          {
            "in": "path",
            "name": "form_slug",
            "required": true,
            "schema": {
              "title": "Form Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitFormRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Form",
        "tags": [
          "platform-forms-public"
        ]
      }
    },
    "/v1/public/forms/{form_slug}/upload-url": {
      "post": {
        "description": "Get a presigned R2 upload URL for a file/photo form field.\n\nClient uploads directly to R2 via PUT to the returned URL.\nThe media_id is stored in the answers dict on draft save/submit.",
        "operationId": "get_upload_url_v1_public_forms__form_slug__upload_url_post",
        "parameters": [
          {
            "in": "path",
            "name": "form_slug",
            "required": true,
            "schema": {
              "title": "Form Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Upload Url",
        "tags": [
          "platform-forms-public"
        ]
      }
    },
    "/v1/public/models": {
      "get": {
        "operationId": "list_models_public_v1_public_models_get",
        "parameters": [
          {
            "in": "query",
            "name": "modality",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Modality"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ModelCatalogOut"
                  },
                  "title": "Response List Models Public V1 Public Models Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Models Public",
        "tags": [
          "model-catalog-public"
        ]
      }
    },
    "/v1/public/signup": {
      "post": {
        "description": "Create a new customer account and auto-place on a shared node.\n\nSends a verification code to the customer's email.\nReturns 503 if no shared hosting capacity is available.",
        "operationId": "create_signup_v1_public_signup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Signup",
        "tags": [
          "customer-signup"
        ]
      }
    },
    "/v1/public/signup/plans/{tenant_slug}": {
      "get": {
        "description": "List available plans for a tenant's shared hosting.",
        "operationId": "list_plans_v1_public_signup_plans__tenant_slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_slug",
            "required": true,
            "schema": {
              "title": "Tenant Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__customer_signup__PlanOut"
                  },
                  "title": "Response List Plans V1 Public Signup Plans  Tenant Slug  Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Plans",
        "tags": [
          "customer-signup"
        ]
      }
    },
    "/v1/public/signup/verify": {
      "post": {
        "description": "Verify signup code and return portal JWT tokens.",
        "operationId": "verify_signup_v1_public_signup_verify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Signup",
        "tags": [
          "customer-signup"
        ]
      }
    },
    "/v1/public/widget/{instance_id}/chat": {
      "post": {
        "description": "Public widget chat \u2014 authenticates via X-Widget-Token header.\n\nWidget tokens are instance-scoped, chat-only. NOT tenant JWTs.\nThe control plane validates the token, then streams SSE from the agent.",
        "operationId": "widget_chat_v1_public_widget__instance_id__chat_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Widget Chat",
        "tags": [
          "public"
        ]
      }
    },
    "/v1/quotes": {
      "get": {
        "operationId": "tenant_list_quotes_v1_quotes_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Quotes",
        "tags": [
          "finance"
        ]
      }
    },
    "/v1/recipes": {
      "get": {
        "operationId": "list_recipes_v1_recipes_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RecipeOut"
                  },
                  "title": "Response List Recipes V1 Recipes Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Recipes",
        "tags": [
          "recipes"
        ]
      },
      "post": {
        "operationId": "create_recipe_v1_recipes_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecipeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Recipe",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/recipes/ai-assist": {
      "post": {
        "description": "Generate a draft recipe configuration from a natural-language description.\n\nCalls a configured LLM to convert the user's description into structured\nrecipe fields (name, system_prompt, skills, channels, integrations).\nThe response is validated against the allowed skill/channel/integration\ncatalogs \u2014 unknown slugs are filtered out.",
        "operationId": "ai_assist_recipe_v1_recipes_ai_assist_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAssistRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Ai Assist Recipe",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/recipes/compose": {
      "post": {
        "description": "Resolve a recipe + overrides into a full agent config.\n\nValidates against tenant's approved primitives registry. Returns the\nresolved config and any validation violations (non-blocking warnings).",
        "operationId": "compose_agent_config_endpoint_v1_recipes_compose_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComposeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComposeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Compose Agent Config Endpoint",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/recipes/deploy": {
      "post": {
        "description": "Deploy a new instance from a recipe.\n\nRuns preflight (composition + validation + connection check).\nIf ready: enqueues provisioning with resolved recipe_config.\nAuto-wire side effects (channels, grants, rules, onboarding) happen\ninside the provisioning worker after Instance row creation.\n\nIdempotent on idempotency_key: returns existing instance if already deployed.",
        "operationId": "deploy_from_recipe_v1_recipes_deploy_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__recipes__DeployRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__recipes__DeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Deploy From Recipe",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/recipes/deploy-check": {
      "post": {
        "description": "Pre-flight check before deploying from recipe.\n\nResolves the template + overrides, checks connection requirements against\nthe customer's existing connections, validates against approved primitives.\nReturns whether the deployment is ready or what's missing.",
        "operationId": "deploy_check_v1_recipes_deploy_check_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployFromRecipeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployCheckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Deploy Check",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/recipes/save-from-instance/{instance_id}": {
      "post": {
        "description": "Capture a configured instance as a reusable recipe.\n\nExtracts: system prompt, skills, voice config, channel types, workflow refs,\ndata_access, model policy, MCP servers, compliance config, connection requirements.\n\nStrips: customer_id, API keys, phone numbers, connection credentials,\ninstance-specific IDs.",
        "operationId": "save_instance_as_recipe_v1_recipes_save_from_instance__instance_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAsTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Save Instance As Recipe",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/recipes/{template_id}": {
      "delete": {
        "operationId": "delete_recipe_v1_recipes__template_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Recipe",
        "tags": [
          "recipes"
        ]
      },
      "get": {
        "operationId": "get_recipe_v1_recipes__template_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Recipe",
        "tags": [
          "recipes"
        ]
      },
      "put": {
        "operationId": "update_recipe_v1_recipes__template_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecipeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Recipe",
        "tags": [
          "recipes"
        ]
      }
    },
    "/v1/rule-templates": {
      "get": {
        "operationId": "list_templates_v1_rule_templates_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__rule_templates__TemplateOut"
                  },
                  "title": "Response List Templates V1 Rule Templates Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Templates",
        "tags": [
          "rule-templates"
        ]
      },
      "post": {
        "operationId": "create_template_v1_rule_templates_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__rule_templates__TemplateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__rule_templates__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Template",
        "tags": [
          "rule-templates"
        ]
      }
    },
    "/v1/rule-templates/{template_id}": {
      "delete": {
        "operationId": "delete_template_v1_rule_templates__template_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Template",
        "tags": [
          "rule-templates"
        ]
      },
      "get": {
        "operationId": "get_template_v1_rule_templates__template_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__rule_templates__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Template",
        "tags": [
          "rule-templates"
        ]
      },
      "put": {
        "operationId": "update_template_v1_rule_templates__template_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__rule_templates__TemplateUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__rule_templates__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Template",
        "tags": [
          "rule-templates"
        ]
      }
    },
    "/v1/rule-templates/{template_id}/applications": {
      "get": {
        "operationId": "list_applications_v1_rule_templates__template_id__applications_get",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ApplicationOut"
                  },
                  "title": "Response List Applications V1 Rule Templates  Template Id  Applications Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Applications",
        "tags": [
          "rule-templates"
        ]
      }
    },
    "/v1/rule-templates/{template_id}/apply": {
      "post": {
        "description": "Apply a rule template to a customer.\n\nCreates BusinessRule rows from the template's rule definitions.\nRules with rule_key that already exist for the customer are skipped\n(customer may have overrides). Rules without rule_key are always created.\n\nOwen F5 (boundary on body.customer_id): pre-fix only\n`verify_customer_in_tenant` ran, which checks tenant scope but\nnot customer-boundary. A within-customer admin in customer A\ncould apply a tenant template to customer B's account by passing\nbody.customer_id=B. Now `enforce_customer_scope` runs first.",
        "operationId": "apply_template_v1_rule_templates__template_id__apply_post",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplyResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Apply Template",
        "tags": [
          "rule-templates"
        ]
      }
    },
    "/v1/rules": {
      "get": {
        "description": "List business rules for the current tenant.\n\nOptionally filter by instance_id or active status.\n\nOwen F4 (inherited-default reads): non-admins see rows where\n`customer_id == user.customer_id` OR `customer_id IS NULL`\n(tenant-default rules are inherited by every customer). Tenant\nadmins see every rule in the tenant.\n\n\"Round up the usual suspects.\" \u2014 Captain Renault, Casablanca",
        "operationId": "list_rules_v1_rules_get",
        "parameters": [
          {
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Instance Id"
            }
          },
          {
            "in": "query",
            "name": "active_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Active Only",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RuleOut"
                  },
                  "title": "Response List Rules V1 Rules Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Rules",
        "tags": [
          "rules"
        ]
      },
      "post": {
        "description": "Create a new business rule.\n\nRequires admin role. Validates trigger event, conditions, and actions.\n\nOwen-locked strict-write contract: non-admin + customer_id=None\nis rejected. Tenant-default rules are admin-only. The list/read\nside honors inherited-default semantics (own + NULL visible),\nbut writes stay strict so a within-customer admin can't mint\nfan-out rules.\n\n\"There are two types of people in this world: those with rules, and those\nwho dig. You dig.\" \u2014 The Good, the Bad and the Ugly (paraphrased)",
        "operationId": "create_rule_v1_rules_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/v1/rules/replayable-services": {
      "get": {
        "description": "List services registered for approval replay.\n\nThe frontend uses this to populate the require_approval service picker.",
        "operationId": "list_replayable_services_v1_rules_replayable_services_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "object"
                  },
                  "title": "Response List Replayable Services V1 Rules Replayable Services Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Replayable Services",
        "tags": [
          "rules"
        ]
      }
    },
    "/v1/rules/trigger-types": {
      "get": {
        "description": "List all available trigger event types and their payload schemas.\n\nThe frontend uses this to populate the trigger selector and build\ndynamic condition forms.\n\n\"Choose wisely.\" \u2014 Grail Knight, Indiana Jones and the Last Crusade",
        "operationId": "list_trigger_types_v1_rules_trigger_types_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TriggerTypeOut"
                  },
                  "title": "Response List Trigger Types V1 Rules Trigger Types Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Trigger Types",
        "tags": [
          "rules"
        ]
      }
    },
    "/v1/rules/{rule_id}": {
      "delete": {
        "description": "Delete a business rule.\n\nRequires admin role. Gone forever \u2014 no soft delete.\nStrict-write: non-admin cannot delete tenant-default rules.\n\"Hasta la vista, baby.\" \u2014 T-800, Terminator 2",
        "operationId": "delete_rule_v1_rules__rule_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "rule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Rule",
        "tags": [
          "rules"
        ]
      },
      "get": {
        "description": "Get a specific business rule by ID.\n\nOwen F6 (inherited-default read): non-admins can read tenant-\ndefault rules (customer_id IS NULL) since those rules apply to\nthem anyway. Other-customer rows still 403. Tenant admins read\neverything in the tenant.\n\n\"Elementary, my dear Watson.\" \u2014 Sherlock Holmes (never actually said it)",
        "operationId": "get_rule_v1_rules__rule_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "rule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Rule",
        "tags": [
          "rules"
        ]
      },
      "patch": {
        "description": "Update an existing business rule.\n\nRequires admin role. Only provided fields are updated.\n\nOwen-locked strict-write: non-admin cannot mutate tenant-default\nrules even though they can READ them (inherited-default).\n\"Improvise, adapt, overcome.\" \u2014 Bear Grylls (about updating rules on the fly)",
        "operationId": "update_rule_v1_rules__rule_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "rule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/v1/rules/{rule_id}/test": {
      "post": {
        "description": "Dry-run test a rule against a sample payload.\n\nEvaluates conditions but does NOT execute actions. Strict-write\nboundary \u2014 non-admin cannot dry-run a tenant-default rule.\n\n\"This is a test. This is only a test.\" \u2014 Emergency Broadcast System",
        "operationId": "test_rule_v1_rules__rule_id__test_post",
        "parameters": [
          {
            "in": "path",
            "name": "rule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Rule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleTestResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Test Rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/v1/schedules": {
      "get": {
        "operationId": "list_schedules_v1_schedules_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "external_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "External Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Schedules V1 Schedules Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Schedules",
        "tags": [
          "scheduled-actions"
        ]
      },
      "post": {
        "operationId": "create_schedule_v1_schedules_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Schedule",
        "tags": [
          "scheduled-actions"
        ]
      }
    },
    "/v1/schedules/{schedule_id}": {
      "delete": {
        "operationId": "delete_schedule_v1_schedules__schedule_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Schedule",
        "tags": [
          "scheduled-actions"
        ]
      },
      "get": {
        "operationId": "get_schedule_v1_schedules__schedule_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Schedule",
        "tags": [
          "scheduled-actions"
        ]
      },
      "put": {
        "operationId": "update_schedule_v1_schedules__schedule_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Schedule",
        "tags": [
          "scheduled-actions"
        ]
      }
    },
    "/v1/schedules/{schedule_id}/pause": {
      "post": {
        "operationId": "pause_schedule_v1_schedules__schedule_id__pause_post",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Pause Schedule V1 Schedules  Schedule Id  Pause Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Pause Schedule",
        "tags": [
          "scheduled-actions"
        ]
      }
    },
    "/v1/schedules/{schedule_id}/resume": {
      "post": {
        "operationId": "resume_schedule_v1_schedules__schedule_id__resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Resume Schedule V1 Schedules  Schedule Id  Resume Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resume Schedule",
        "tags": [
          "scheduled-actions"
        ]
      }
    },
    "/v1/schedules/{schedule_id}/runs": {
      "get": {
        "operationId": "list_schedule_runs_v1_schedules__schedule_id__runs_get",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Schedule Runs V1 Schedules  Schedule Id  Runs Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Schedule Runs",
        "tags": [
          "scheduled-actions"
        ]
      }
    },
    "/v1/schedules/{schedule_id}/trigger": {
      "post": {
        "description": "Force immediate execution of a schedule (ignores next_run_at).",
        "operationId": "trigger_schedule_v1_schedules__schedule_id__trigger_post",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Trigger Schedule V1 Schedules  Schedule Id  Trigger Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Trigger Schedule",
        "tags": [
          "scheduled-actions"
        ]
      }
    },
    "/v1/scores/overview": {
      "get": {
        "operationId": "scores_overview_v1_scores_overview_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 7,
              "maximum": 90,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScoresOverviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Scores Overview",
        "tags": [
          "scores"
        ]
      }
    },
    "/v1/settings": {
      "get": {
        "description": "Get current user's settings - profile and API keys.\n\"I'm not even supposed to be here today.\" - Dante, Clerks",
        "operationId": "get_settings_v1_settings_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Settings",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/api-keys": {
      "post": {
        "description": "Generate a new platform API key. Plaintext returned ONCE.\n\"Say hello to my little friend!\" - Tony Montana, Scarface\n(introducing your new API key)",
        "operationId": "create_api_key_v1_settings_api_keys_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Api Key",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/api-keys/{key_id}": {
      "delete": {
        "description": "Revoke an API key. Permanent - no undo.\n\"Hasta la vista, baby.\" - T-800, Terminator 2",
        "operationId": "revoke_api_key_v1_settings_api_keys__key_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Api Key",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/password": {
      "put": {
        "description": "Change password - requires current password verification.\n\"You shall not pass!\" - Gandalf (without the right current password)",
        "operationId": "change_password_v1_settings_password_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Change Password",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/profile": {
      "put": {
        "description": "Update display name.\n\"They call me MISTER Tibbs!\" - Virgil Tibbs, In the Heat of the Night",
        "operationId": "update_profile_v1_settings_profile_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Profile",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/shared-hosting/customers/{customer_id}/config": {
      "get": {
        "operationId": "get_customer_config_overlay_v1_shared_hosting_customers__customer_id__config_get",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Customer Config Overlay",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/shared-hosting/customers/{customer_id}/instances/{instance_id}": {
      "delete": {
        "operationId": "remove_customer_v1_shared_hosting_customers__customer_id__instances__instance_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Customer",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/shared-hosting/customers/{customer_id}/instances/{instance_id}/config": {
      "put": {
        "operationId": "update_customer_config_overlay_v1_shared_hosting_customers__customer_id__instances__instance_id__config_put",
        "parameters": [
          {
            "in": "path",
            "name": "customer_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Customer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Customer Config Overlay",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/shared-hosting/nodes": {
      "get": {
        "operationId": "list_agent_host_nodes_v1_shared_hosting_nodes_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentHostNodeOut"
                  },
                  "title": "Response List Agent Host Nodes V1 Shared Hosting Nodes Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Agent Host Nodes",
        "tags": [
          "shared-hosting"
        ]
      },
      "post": {
        "operationId": "create_agent_host_node_v1_shared_hosting_nodes_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentHostNodeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentHostNodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Agent Host Node",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/shared-hosting/nodes/{node_id}": {
      "patch": {
        "operationId": "update_agent_host_node_v1_shared_hosting_nodes__node_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "node_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Node Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentHostNodeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentHostNodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Agent Host Node",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/shared-hosting/nodes/{node_id}/customers": {
      "get": {
        "description": "List all customers placed on a shared node.",
        "operationId": "list_node_customers_v1_shared_hosting_nodes__node_id__customers_get",
        "parameters": [
          {
            "in": "path",
            "name": "node_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Node Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/NodeCustomerOut"
                  },
                  "title": "Response List Node Customers V1 Shared Hosting Nodes  Node Id  Customers Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Node Customers",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/shared-hosting/place": {
      "post": {
        "operationId": "place_customer_v1_shared_hosting_place_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceCustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceCustomerOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Place Customer",
        "tags": [
          "shared-hosting"
        ]
      }
    },
    "/v1/stripe/connect/dashboard-link": {
      "post": {
        "description": "Generate a Stripe Express dashboard login link.\n\nLets the PaaS customer access their Stripe dashboard to view\npayouts, transactions, and manage their account settings.\n\n\"Follow the money.\" \u2014 Deep Throat, All the President's Men",
        "operationId": "create_dashboard_link_v1_stripe_connect_dashboard_link_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardLinkOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Dashboard Link",
        "tags": [
          "stripe"
        ]
      }
    },
    "/v1/stripe/connect/onboard": {
      "post": {
        "description": "Create or resume Stripe Connect onboarding.\n\nIf the customer doesn't have a connected account yet, creates one.\nReturns an Account Link URL that redirects the customer to Stripe's\nhosted onboarding flow (Express).\n\n\"You had me at hello.\" \u2014 Dorothy Boyd, Jerry Maguire\n(about Stripe's hosted onboarding UX)",
        "operationId": "create_onboard_link_v1_stripe_connect_onboard_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardLinkOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Onboard Link",
        "tags": [
          "stripe"
        ]
      }
    },
    "/v1/stripe/connect/status": {
      "get": {
        "description": "Check the current Stripe Connect account status.\n\n\"Are you not entertained?\" \u2014 Maximus, Gladiator\n(about checking if Stripe onboarding is complete)",
        "operationId": "get_connect_status_v1_stripe_connect_status_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Connect Status",
        "tags": [
          "stripe"
        ]
      }
    },
    "/v1/team/invitations": {
      "get": {
        "description": "List all invitations for the current team.\n\nAdmins and owners can see all invitations.\n\"Papers, please.\" \u2014 Inspector, Papers Please",
        "operationId": "list_invitations_v1_team_invitations_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/InvitationOut"
                  },
                  "title": "Response List Invitations V1 Team Invitations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Invitations",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/team/invitations/accept": {
      "post": {
        "description": "Accept a team invitation.\n\nThe authenticated user accepts the invite. Their customer_id is switched\nto the inviting team's customer, and they get the invited role.\n\n\"Welcome to the party, pal!\" \u2014 John McClane, Die Hard",
        "operationId": "accept_invitation_v1_team_invitations_accept_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationAcceptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Accept Invitation",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/team/invitations/{invitation_id}": {
      "delete": {
        "description": "Revoke a pending invitation.\n\n\"You're fired!\" \u2014 Donald Trump / also Stryker in Hot Shots! Part Deux",
        "operationId": "revoke_invitation_v1_team_invitations__invitation_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Invitation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Invitation",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/team/invite": {
      "post": {
        "description": "Invite someone to join the team by email.\n\nOnly owners and admins can send invitations. You can't invite someone\nwho's already on the team, and you can't grant a role higher than your own.\n\n\"I'm putting together a special team.\" \u2014 Nick Fury, The Avengers",
        "operationId": "invite_member_v1_team_invite_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Invite Member",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/team/members": {
      "get": {
        "description": "List all members of the current user's team.\n\nAny team member can see the list. It's not a secret club.\n\"First rule of Fight Club: you do not talk about Fight Club.\" \u2014 Tyler Durden\n(but this isn't Fight Club, so go ahead)",
        "operationId": "list_team_members_v1_team_members_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TeamMemberOut"
                  },
                  "title": "Response List Team Members V1 Team Members Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Team Members",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/team/members/{member_id}": {
      "delete": {
        "description": "Remove a member from the team.\n\nOwners can remove anyone. Admins can remove members and billing users.\nYou can remove yourself (leave the team) unless you're the last owner.\n\n\"Get to the chopper!\" \u2014 Dutch, Predator (about leaving the team)",
        "operationId": "remove_member_v1_team_members__member_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Member Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Member",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/team/members/{member_id}/role": {
      "patch": {
        "description": "Update a team member's role.\n\nOnly owners can promote to admin. Admins can set member/billing roles.\nNobody can demote the last owner. That would be anarchy.\n\n\"You have no power here, Gandalf the Grey.\" \u2014 Th\u00e9oden (under Saruman's spell)",
        "operationId": "update_member_role_v1_team_members__member_id__role_patch",
        "parameters": [
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Member Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Member Role",
        "tags": [
          "team"
        ]
      }
    },
    "/v1/templates": {
      "get": {
        "description": "List all available website templates \u2014 public catalog, no auth required.\n\nReturns active templates ordered by display_order.\n\"Life is like a box of chocolates...\" \u2014 Forrest Gump\n(and website templates are like a box of verticals)",
        "operationId": "list_templates_v1_templates_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__websites__TemplateOut"
                  },
                  "title": "Response List Templates V1 Templates Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Templates",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/gallery": {
      "get": {
        "description": "List platform templates + tenant-visible templates for the current user.",
        "operationId": "list_template_gallery_v1_templates_gallery_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__websites__TemplateOut"
                  },
                  "title": "Response List Template Gallery V1 Templates Gallery Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Template Gallery",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/gallery/{template_id}/instantiate": {
      "post": {
        "operationId": "instantiate_gallery_template_v1_templates_gallery__template_id__instantiate_post",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateInstantiateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateInstantiateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Instantiate Gallery Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/gallery/{template_id}/preview": {
      "get": {
        "operationId": "preview_gallery_template_v1_templates_gallery__template_id__preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePreviewArtifactOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Preview Gallery Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/import": {
      "post": {
        "description": "Promote a validated custom upload into a tenant-owned reusable template.",
        "operationId": "import_template_from_upload_v1_templates_import_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__websites__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Import Template From Upload",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/library/{template_id}": {
      "patch": {
        "description": "Update tenant-owned template metadata and visibility.",
        "operationId": "update_tenant_template_v1_templates_library__template_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Template Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__websites__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Tenant Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/{slug}": {
      "get": {
        "description": "Get a specific template by slug \u2014 public, no auth required.",
        "operationId": "get_template_v1_templates__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__websites__TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/{slug}/preview": {
      "get": {
        "operationId": "get_template_preview_v1_templates__slug__preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePreviewArtifactOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Template Preview",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/tenant/agent-persona": {
      "get": {
        "operationId": "get_persona_v1_tenant_agent_persona_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Persona",
        "tags": [
          "tenant"
        ]
      },
      "put": {
        "operationId": "set_persona_v1_tenant_agent_persona_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonaIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Persona",
        "tags": [
          "tenant"
        ]
      }
    },
    "/v1/timesheets": {
      "get": {
        "operationId": "tenant_list_timesheets_v1_timesheets_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "approval_status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Approval Status"
            }
          },
          {
            "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"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Tenant List Timesheets",
        "tags": [
          "finance"
        ]
      }
    },
    "/v1/triggers": {
      "get": {
        "operationId": "list_triggers_v1_triggers_get",
        "parameters": [
          {
            "description": "Filter: 'schedule' or 'event'",
            "in": "query",
            "name": "trigger_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter: 'schedule' or 'event'",
              "title": "Trigger Type"
            }
          },
          {
            "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": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggersListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Triggers",
        "tags": [
          "triggers"
        ]
      },
      "post": {
        "operationId": "create_trigger_v1_triggers_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Trigger",
        "tags": [
          "triggers"
        ]
      }
    },
    "/v1/triggers/{trigger_id}": {
      "delete": {
        "operationId": "delete_trigger_v1_triggers__trigger_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "trigger_id",
            "required": true,
            "schema": {
              "title": "Trigger Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Trigger",
        "tags": [
          "triggers"
        ]
      },
      "patch": {
        "operationId": "patch_trigger_v1_triggers__trigger_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "trigger_id",
            "required": true,
            "schema": {
              "title": "Trigger Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Patch Trigger",
        "tags": [
          "triggers"
        ]
      }
    },
    "/v1/usage/budget-status": {
      "get": {
        "description": "Budget status for an instance. Reads from llm_usage_events (authoritative source).",
        "operationId": "budget_status_v1_usage_budget_status_get",
        "parameters": [
          {
            "in": "query",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Budget Status",
        "tags": [
          "usage"
        ]
      }
    },
    "/v1/usage/summary": {
      "get": {
        "description": "Usage summary with drill-down by customer/instance/model/key_source.",
        "operationId": "usage_summary_v1_usage_summary_get",
        "parameters": [
          {
            "description": "today|week|month",
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "default": "today",
              "description": "today|week|month",
              "title": "Period",
              "type": "string"
            }
          },
          {
            "description": "Group by: customer, instance, model, or key_source",
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "default": "customer",
              "description": "Group by: customer, instance, model, or key_source",
              "title": "Group By",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "instance_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Usage Summary V1 Usage Summary Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Usage Summary",
        "tags": [
          "usage"
        ]
      }
    },
    "/v1/webhost/nodes": {
      "get": {
        "operationId": "list_webhost_nodes_v1_webhost_nodes_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebHostNodeOut"
                  },
                  "title": "Response List Webhost Nodes V1 Webhost Nodes Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Webhost Nodes",
        "tags": [
          "webhost"
        ]
      },
      "post": {
        "operationId": "create_webhost_node_v1_webhost_nodes_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebHostNodeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebHostNodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Webhost Node",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/nodes/{node_id}": {
      "get": {
        "operationId": "get_webhost_node_v1_webhost_nodes__node_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "node_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Node Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebHostNodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Webhost Node",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/nodes/{node_id}/capacity": {
      "get": {
        "operationId": "get_webhost_capacity_v1_webhost_nodes__node_id__capacity_get",
        "parameters": [
          {
            "in": "path",
            "name": "node_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Node Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebHostCapacityOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Webhost Capacity",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/nodes/{node_id}/telemetry": {
      "get": {
        "operationId": "get_webhost_node_telemetry_v1_webhost_nodes__node_id__telemetry_get",
        "parameters": [
          {
            "in": "path",
            "name": "node_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Node Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebHostNodeTelemetryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Webhost Node Telemetry",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites": {
      "get": {
        "operationId": "list_hosted_websites_v1_webhost_sites_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/HostedWebsiteOut"
                  },
                  "title": "Response List Hosted Websites V1 Webhost Sites Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Hosted Websites",
        "tags": [
          "webhost"
        ]
      },
      "post": {
        "operationId": "create_hosted_website_v1_webhost_sites_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HostedWebsiteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Hosted Website",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}": {
      "delete": {
        "operationId": "delete_hosted_website_v1_webhost_sites__website_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Hosted Website",
        "tags": [
          "webhost"
        ]
      },
      "get": {
        "operationId": "get_hosted_website_v1_webhost_sites__website_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Hosted Website",
        "tags": [
          "webhost"
        ]
      },
      "patch": {
        "operationId": "update_hosted_website_v1_webhost_sites__website_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HostedWebsiteUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Hosted Website",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/analytics": {
      "get": {
        "description": "Get analytics summary for a hosted website.",
        "operationId": "get_website_analytics_v1_webhost_sites__website_id__analytics_get",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "default": 7,
              "title": "Period",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSummaryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Website Analytics",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/deploy": {
      "post": {
        "operationId": "deploy_hosted_website_v1_webhost_sites__website_id__deploy_post",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteDeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Deploy Hosted Website",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/forms": {
      "get": {
        "description": "List form submissions for a hosted website.",
        "operationId": "list_form_submissions_v1_webhost_sites__website_id__forms_get",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unread_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Unread Only",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FormSubmissionOut"
                  },
                  "title": "Response List Form Submissions V1 Webhost Sites  Website Id  Forms Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Form Submissions",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/forms/stats": {
      "get": {
        "description": "Get submission count and unread count for a hosted website.",
        "operationId": "get_form_submission_stats_v1_webhost_sites__website_id__forms_stats_get",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormSubmissionStats"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Form Submission Stats",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/forms/{submission_id}": {
      "patch": {
        "description": "Mark a form submission as read.",
        "operationId": "mark_form_submission_read_v1_webhost_sites__website_id__forms__submission_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "submission_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Submission Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormSubmissionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Mark Form Submission Read",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/history": {
      "get": {
        "operationId": "get_hosted_website_history_v1_webhost_sites__website_id__history_get",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebsiteReleaseOut"
                  },
                  "title": "Response Get Hosted Website History V1 Webhost Sites  Website Id  History Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Hosted Website History",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/live-migrate": {
      "post": {
        "operationId": "live_migrate_hosted_website_endpoint_v1_webhost_sites__website_id__live_migrate_post",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiveMigrateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteDeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Live Migrate Hosted Website Endpoint",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/migrate": {
      "post": {
        "operationId": "migrate_hosted_website_v1_webhost_sites__website_id__migrate_post",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HostedWebsiteMigrateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Migrate Hosted Website",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/webhost/sites/{website_id}/rollback": {
      "post": {
        "operationId": "rollback_hosted_website_v1_webhost_sites__website_id__rollback_post",
        "parameters": [
          {
            "in": "path",
            "name": "website_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Website Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebsiteRollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedWebsiteOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Rollback Hosted Website",
        "tags": [
          "webhost"
        ]
      }
    },
    "/v1/website": {
      "get": {
        "description": "List all website configurations for the current tenant.\n\nReturns one config per instance (plus any unlinked drafts).\nOptionally filter by customer_id to get a specific customer's sites.\n\"I see dead pixels.\" \u2014 Cole Sear, The Sixth Sense (on empty config lists)",
        "operationId": "list_website_configs_v1_website_get",
        "parameters": [
          {
            "description": "Filter by customer owner",
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by customer owner",
              "title": "Customer Id"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebsiteConfigOut"
                  },
                  "title": "Response List Website Configs V1 Website Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Website Configs",
        "tags": [
          "websites"
        ]
      },
      "put": {
        "description": "Legacy: update the tenant's most recent website config.\n\nBackwards compat for /dashboard/website page. Picks the newest config.\nNew code should use PUT /v1/instances/{id}/website instead.\n\n\"I'm not dead yet!\" \u2014 Plague victim, Monty Python and the Holy Grail\n(about legacy endpoints that refuse to die)",
        "operationId": "update_website_config_legacy_v1_website_put",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebsiteConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebsiteConfigOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Website Config Legacy",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/website/deploy": {
      "post": {
        "description": "Deploy a website by creating a new VPS instance.\n\nCreates a NEW instance with website template + brand config injected.\nFor the first deploy or when no instance_id is in the body, creates an\nunlinked config then provisions. The provisioning callback links them.\n\n\"Yippee-ki-yay.\" \u2014 John McClane, Die Hard\n(what every reseller says when their branded site goes live)",
        "operationId": "deploy_website_v1_website_deploy_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__websites__DeployRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__websites__DeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Deploy Website",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/website/preview": {
      "get": {
        "description": "Legacy: preview the tenant's most recent website config.\n\nBackwards compat for /dashboard/website page. New code should use\nGET /v1/instances/{id}/website/preview.\n\n\"What we've got here is failure to communicate.\" \u2014 Captain, Cool Hand Luke\n(about legacy endpoints that still need to work)",
        "operationId": "preview_website_legacy_v1_website_preview_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Preview Website Legacy",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/website/upload": {
      "post": {
        "description": "Upload a custom website archive (zip or tarball).\n\nAdmin only. Max 100MB. Archive is validated synchronously before\npersistence \u2014 bad uploads are rejected immediately, nothing hits R2\nor the database until structural checks pass.\nSupported: .zip, .tar.gz, .tgz\n\n\"I'll be back.\" \u2014 T-800 (after uploading a custom site)",
        "operationId": "upload_custom_site_v1_website_upload_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_custom_site_v1_website_upload_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Upload Custom Site",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/website/uploads": {
      "get": {
        "description": "List the current tenant's custom site uploads.",
        "operationId": "list_uploads_v1_website_uploads_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UploadOut"
                  },
                  "title": "Response List Uploads V1 Website Uploads Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Uploads",
        "tags": [
          "websites"
        ]
      }
    },
    "/v1/website/{config_id}/media": {
      "get": {
        "operationId": "list_media_v1_website__config_id__media_get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MediaOut"
                  },
                  "title": "Response List Media V1 Website  Config Id  Media Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Media",
        "tags": [
          "website-media"
        ]
      },
      "post": {
        "operationId": "upload_media_v1_website__config_id__media_post",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "alt_text",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 500,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Alt Text"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_media_v1_website__config_id__media_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Upload Media",
        "tags": [
          "website-media"
        ]
      }
    },
    "/v1/website/{config_id}/media/{media_id}": {
      "delete": {
        "operationId": "delete_media_v1_website__config_id__media__media_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Media Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Media",
        "tags": [
          "website-media"
        ]
      },
      "get": {
        "operationId": "get_media_v1_website__config_id__media__media_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Media Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Media",
        "tags": [
          "website-media"
        ]
      }
    },
    "/v1/website/{config_id}/pages": {
      "get": {
        "operationId": "list_pages_v1_website__config_id__pages_get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PageOut"
                  },
                  "title": "Response List Pages V1 Website  Config Id  Pages Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Pages",
        "tags": [
          "website-pages"
        ]
      },
      "post": {
        "operationId": "create_page_v1_website__config_id__pages_post",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Page",
        "tags": [
          "website-pages"
        ]
      }
    },
    "/v1/website/{config_id}/pages/{slug}": {
      "delete": {
        "operationId": "delete_page_v1_website__config_id__pages__slug__delete",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Page",
        "tags": [
          "website-pages"
        ]
      },
      "get": {
        "operationId": "get_page_v1_website__config_id__pages__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Page",
        "tags": [
          "website-pages"
        ]
      },
      "put": {
        "operationId": "update_page_v1_website__config_id__pages__slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Page",
        "tags": [
          "website-pages"
        ]
      }
    },
    "/v1/workflow-files": {
      "get": {
        "operationId": "list_workflows_v1_workflow_files_get",
        "parameters": [
          {
            "in": "query",
            "name": "include_superseded",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Superseded",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/src__api__workflow_files__WorkflowOut"
                  },
                  "title": "Response List Workflows V1 Workflow Files Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Workflows",
        "tags": [
          "workflow-files"
        ]
      },
      "post": {
        "operationId": "create_workflow_v1_workflow_files_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__workflow_files__WorkflowCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflow_files__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Workflow",
        "tags": [
          "workflow-files"
        ]
      }
    },
    "/v1/workflow-files/{workflow_id}": {
      "delete": {
        "operationId": "delete_workflow_v1_workflow_files__workflow_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Workflow",
        "tags": [
          "workflow-files"
        ]
      },
      "get": {
        "operationId": "get_workflow_v1_workflow_files__workflow_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflow_files__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Workflow",
        "tags": [
          "workflow-files"
        ]
      },
      "put": {
        "description": "Update a draft workflow. Signed/active workflows cannot be edited \u2014 create a new version instead.",
        "operationId": "update_workflow_v1_workflow_files__workflow_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflow_files__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Workflow",
        "tags": [
          "workflow-files"
        ]
      }
    },
    "/v1/workflow-files/{workflow_id}/activate": {
      "post": {
        "description": "Sign and activate a workflow. Supersedes any previous active version of the same slug.",
        "operationId": "activate_workflow_v1_workflow_files__workflow_id__activate_post",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowActivateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflow_files__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Activate Workflow",
        "tags": [
          "workflow-files"
        ]
      }
    },
    "/v1/workflow-files/{workflow_id}/new-version": {
      "post": {
        "description": "Create a new version of an existing workflow. The old version remains until the new one is activated.",
        "operationId": "create_new_version_v1_workflow_files__workflow_id__new_version_post",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__workflow_files__WorkflowCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflow_files__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create New Version",
        "tags": [
          "workflow-files"
        ]
      }
    },
    "/v1/workflows": {
      "get": {
        "description": "List workflow records for tenant dashboard observability.\nAuth: JWT (admin only). RLS scopes to tenant.",
        "operationId": "list_workflows_dashboard_v1_workflows_get",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Id"
            }
          },
          {
            "in": "query",
            "name": "workflow_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Workflow Type"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Workflows Dashboard",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/suspended": {
      "get": {
        "description": "List all suspended workflows for the tenant.\nAuth: JWT (admin only). RLS scopes to tenant.",
        "operationId": "list_suspended_workflows_v1_workflows_suspended_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "object"
                  },
                  "title": "Response List Suspended Workflows V1 Workflows Suspended Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Suspended Workflows",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{workflow_id}": {
      "get": {
        "description": "Get workflow detail for tenant dashboard observability.\nAuth: JWT (admin only). RLS scopes to tenant.",
        "operationId": "get_workflow_dashboard_v1_workflows__workflow_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__workflows__WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Workflow Dashboard",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{workflow_id}/abort": {
      "post": {
        "description": "Abort a workflow (transition to 'cancelled').\n\nPreserves audit trail rather than deleting. Only allowed for non-terminal\nstatuses. Auth: JWT (admin only). RLS scopes to tenant.",
        "operationId": "abort_workflow_v1_workflows__workflow_id__abort_post",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResumeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Abort Workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{workflow_id}/resume": {
      "post": {
        "description": "Resume a suspended workflow with resume data.\n\nPicks up from suspended_step with the provided data merged into workflow_state.\nAuth: JWT (admin only). RLS scopes to tenant.",
        "operationId": "resume_workflow_v1_workflows__workflow_id__resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResumeWorkflowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResumeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resume Workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{workflow_id}/suspend": {
      "post": {
        "description": "Suspend a workflow at a specific step with payload to preserve state.\nAuth: JWT (admin only). RLS scopes to tenant.",
        "operationId": "suspend_workflow_v1_workflows__workflow_id__suspend_post",
        "parameters": [
          {
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuspendWorkflowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResumeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Suspend Workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v2/provision": {
      "post": {
        "description": "Provision a new instance via API key.\n\nEnforces:\n1. Rate limiting (5 per 5 min per user)\n2. Active subscription check\n3. Trial expiry check\n4. Per-customer instance quota\n5. Idempotency\n\n\"Yippee-ki-yay, motherf\u2014\" \u2014 John McClane, Die Hard\n(about deploying instances programmatically)",
        "operationId": "provision_instance_api_v2_provision_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__api__provision_api__ProvisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/src__api__provision_api__ProvisionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Provision Instance Api",
        "tags": [
          "provision-api"
        ]
      }
    },
    "/v2/provision/{instance_id}/status": {
      "get": {
        "description": "Check provisioning status of an instance.\n\n\"Are we there yet?\" \u2014 Every kid on a road trip\n(about checking if provisioning is done)",
        "operationId": "get_provision_status_v2_provision__instance_id__status_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Api-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Provision Status",
        "tags": [
          "provision-api"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "admin"
    },
    {
      "name": "admin-tenant-lifecycle"
    },
    {
      "name": "agent-routing"
    },
    {
      "name": "alerts"
    },
    {
      "name": "approvals"
    },
    {
      "name": "approved-primitives"
    },
    {
      "name": "auth"
    },
    {
      "name": "billing"
    },
    {
      "name": "billing-subscriptions"
    },
    {
      "name": "bootstrap"
    },
    {
      "name": "branding"
    },
    {
      "name": "catalog"
    },
    {
      "name": "channels"
    },
    {
      "name": "chat-media"
    },
    {
      "name": "connections"
    },
    {
      "name": "conversations"
    },
    {
      "name": "credits"
    },
    {
      "name": "customer-auth"
    },
    {
      "name": "customer-identities"
    },
    {
      "name": "customer-signup"
    },
    {
      "name": "customers"
    },
    {
      "name": "dashboard"
    },
    {
      "name": "debug-access"
    },
    {
      "name": "demo"
    },
    {
      "name": "domains"
    },
    {
      "name": "edge-routes"
    },
    {
      "name": "email"
    },
    {
      "name": "email-domains"
    },
    {
      "name": "email-inbound"
    },
    {
      "name": "email-internal"
    },
    {
      "name": "email-triggers"
    },
    {
      "name": "end-user-portal"
    },
    {
      "name": "end-user-portal-internal"
    },
    {
      "name": "entity-store"
    },
    {
      "name": "evaluations"
    },
    {
      "name": "finance"
    },
    {
      "name": "google-calendar"
    },
    {
      "name": "google-drive"
    },
    {
      "name": "google-gmail"
    },
    {
      "name": "google-oauth"
    },
    {
      "name": "google-sheets"
    },
    {
      "name": "identity-unification"
    },
    {
      "name": "identity-unification-internal"
    },
    {
      "name": "instance-ops"
    },
    {
      "name": "instances"
    },
    {
      "name": "jobs-shifts"
    },
    {
      "name": "knowledge"
    },
    {
      "name": "knowledge-internal"
    },
    {
      "name": "lifecycle"
    },
    {
      "name": "logs"
    },
    {
      "name": "marketplace"
    },
    {
      "name": "mcp"
    },
    {
      "name": "mcp-credentials-admin"
    },
    {
      "name": "mcp-credentials-internal"
    },
    {
      "name": "metrics"
    },
    {
      "name": "microsoft-oauth"
    },
    {
      "name": "model-catalog"
    },
    {
      "name": "model-catalog-internal"
    },
    {
      "name": "model-catalog-public"
    },
    {
      "name": "model-overrides"
    },
    {
      "name": "models"
    },
    {
      "name": "oauth"
    },
    {
      "name": "onboarding"
    },
    {
      "name": "onboarding-flows"
    },
    {
      "name": "onboarding-instances"
    },
    {
      "name": "onboarding-internal"
    },
    {
      "name": "pin-confirmation"
    },
    {
      "name": "pin-confirmation-internal"
    },
    {
      "name": "platform-forms"
    },
    {
      "name": "platform-forms-internal"
    },
    {
      "name": "platform-forms-public"
    },
    {
      "name": "platform-internal"
    },
    {
      "name": "plugins"
    },
    {
      "name": "plugins-internal"
    },
    {
      "name": "portal"
    },
    {
      "name": "presets"
    },
    {
      "name": "providers"
    },
    {
      "name": "provision-api"
    },
    {
      "name": "public"
    },
    {
      "name": "recipes"
    },
    {
      "name": "roster"
    },
    {
      "name": "rule-templates"
    },
    {
      "name": "rules"
    },
    {
      "name": "runtime-audit"
    },
    {
      "name": "runtime-images"
    },
    {
      "name": "safetyculture"
    },
    {
      "name": "scheduled-actions"
    },
    {
      "name": "scheduled-actions-internal"
    },
    {
      "name": "scores"
    },
    {
      "name": "scoring"
    },
    {
      "name": "settings"
    },
    {
      "name": "shared-hosting"
    },
    {
      "name": "shared-hosting-internal"
    },
    {
      "name": "sheet-import"
    },
    {
      "name": "smoke"
    },
    {
      "name": "sms-channel"
    },
    {
      "name": "sms-webhook"
    },
    {
      "name": "staff"
    },
    {
      "name": "stripe"
    },
    {
      "name": "team"
    },
    {
      "name": "telegram-channel"
    },
    {
      "name": "telegram-webhook"
    },
    {
      "name": "telemetry"
    },
    {
      "name": "templates"
    },
    {
      "name": "tenant"
    },
    {
      "name": "triggers"
    },
    {
      "name": "usage"
    },
    {
      "name": "usage-internal"
    },
    {
      "name": "voice-channel"
    },
    {
      "name": "voice-internal"
    },
    {
      "name": "voice-outbound"
    },
    {
      "name": "voice-webhook"
    },
    {
      "name": "webhost"
    },
    {
      "name": "website-media"
    },
    {
      "name": "website-pages"
    },
    {
      "name": "websites"
    },
    {
      "name": "whatsapp-channel"
    },
    {
      "name": "whatsapp-embedded-signup"
    },
    {
      "name": "whatsapp-templates"
    },
    {
      "name": "whatsapp-webhook"
    },
    {
      "name": "worker"
    },
    {
      "name": "worker-bindings"
    },
    {
      "name": "workflow-files"
    },
    {
      "name": "workflows"
    },
    {
      "name": "workflows-internal"
    },
    {
      "name": "xero"
    }
  ]
}
