{
  "components": {
    "schemas": {
      "data": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PaginatedData-Template"
          }
        },
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "code": {
            "type": "integer"
          },
          "details": {
            "items": {},
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SuccessResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/data"
          }
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {},
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateThresholdParams": {
        "properties": {
          "minThreshold": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "FarcasterWebhookPayload": {
        "properties": {
          "data": {
            "additionalProperties": {},
            "description": "Event-specific data",
            "type": "object"
          },
          "type": {
            "description": "e.g., \"cast.created\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "IntegrationResult": {
        "properties": {
          "action": {
            "description": "\"triggered\", \"resumed\", \"skipped\"",
            "type": "string"
          },
          "eventId": {
            "description": "Webhook event ID for audit",
            "type": "string"
          },
          "reason": {
            "description": "If skipped, the reason",
            "type": "string"
          },
          "runIds": {
            "description": "Multiple if fan-out (platform) or single (generic)",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "SituationDetail": {
        "properties": {
          "asset_class": {
            "type": "string"
          },
          "cluster_id": {
            "type": "string"
          },
          "confidence": {
            "type": "number"
          },
          "confidence_tier": {
            "type": "string"
          },
          "event_at": {
            "type": "string"
          },
          "event_subtype": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "impact": {
            "type": "integer"
          },
          "observed_at": {
            "type": "string"
          },
          "schedule_kind": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "sentiment_label": {
            "type": "string"
          },
          "sentiment_score": {
            "type": "number"
          },
          "summary": {
            "description": "Summary is the classifier's one-sentence headline for the event —\nthe catalyst, actor, and key numbers. This is the actual news text.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SituationMonitorPayload": {
        "properties": {
          "situation": {
            "$ref": "#/components/schemas/SituationDetail"
          },
          "sources": {
            "description": "Source articles/posts behind the situation (situation_sources rows).\nOptional — absent on older worker builds that don't send it.",
            "items": {
              "$ref": "#/components/schemas/SituationSource"
            },
            "type": "array",
            "uniqueItems": false
          },
          "tickers": {
            "description": "Outer envelope fields (worker `WebhookPayload` shape).",
            "items": {
              "$ref": "#/components/schemas/SituationTicker"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "SituationSource": {
        "properties": {
          "observed_at": {
            "type": "string"
          },
          "source_id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SituationTicker": {
        "properties": {
          "asset_class": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "McpConnectorView": {
        "properties": {
          "displayName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "serverId": {
            "type": "string"
          },
          "serverUrl": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResumeResult": {
        "properties": {
          "action": {
            "description": "\"resumed\" or \"skipped\"",
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ArchiveWalletResponse": {
        "properties": {
          "archivedWorkflowIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateWorkflowTemplateRequest": {
        "properties": {
          "category": {
            "description": "Deprecated: use Tags instead",
            "type": "string"
          },
          "cooldownMs": {
            "type": "integer"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "maxLength": 2000,
            "type": "string"
          },
          "maxRuns": {
            "type": "integer"
          },
          "name": {
            "maxLength": 255,
            "type": "string"
          },
          "sourceWorkflowId": {
            "type": "string"
          },
          "tableSchemas": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TableSchema"
            },
            "type": "object"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "templateProps": {
            "items": {
              "$ref": "#/components/schemas/TemplateProp"
            },
            "type": "array",
            "uniqueItems": false
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          },
          "visibility": {
            "$ref": "#/components/schemas/TemplateVisibility"
          }
        },
        "required": ["definition", "description", "name", "tags", "visibility"],
        "type": "object"
      },
      "UpdateWorkflowTemplateRequest": {
        "properties": {
          "cooldownMs": {
            "type": "integer"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "type": "string"
          },
          "maxRuns": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "tableSchemas": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TableSchema"
            },
            "description": "Pointer-to-map so PATCH can distinguish omit-and-preserve (nil) from replace-with-empty.",
            "type": "object"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "templateProps": {
            "items": {
              "$ref": "#/components/schemas/TemplateProp"
            },
            "type": "array",
            "uniqueItems": false
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          },
          "visibility": {
            "$ref": "#/components/schemas/TemplateVisibility"
          }
        },
        "type": "object"
      },
      "StorkAvailableAssetsResponse": {
        "properties": {
          "assets": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "StorkLatestPricesResponse": {
        "properties": {
          "prices": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "{\"BTCUSD\": \"103594.842425999988\"}",
            "type": "object"
          }
        },
        "type": "object"
      },
      "RunEvent": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "seq": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RunState": {
        "properties": {
          "assistantText": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "finishedAt": {
            "type": "string"
          },
          "phase": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "savedWorkflowIds": {
            "description": "SavedWorkflowIDs are the workflow ids the run ACTUALLY saved/edited\n(workflow-builder's wf-save ledger, reported on agent_done; success only).\nMirrored verbatim from the worker so Caddie can refresh the canvas.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "servedPath": {
            "description": "ServedPath is the worker-relative path a serve-capable agent's output is\nserved at (e.g. \"/artifacts/<runId>/\"); ServedURL is the absolute,\nbrowser-openable URL the API composes from it (worker base + path) so a\nclient can surface the built app's link. Both empty for non-serving runs.",
            "type": "string"
          },
          "servedUrl": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "truncated": {
            "description": "Truncated marks a run that hit its budget and stopped mid-task. The\nconsumer relays the answer differently, so dropping these here would\npresent half a report as the whole one.",
            "type": "boolean"
          },
          "truncationReason": {
            "type": "string"
          },
          "turns": {
            "type": "integer"
          },
          "usage": {
            "$ref": "#/components/schemas/RunUsage"
          }
        },
        "type": "object"
      },
      "RunUsage": {
        "properties": {
          "callCount": {
            "type": "integer"
          },
          "completionTokens": {
            "type": "integer"
          },
          "costUsd": {
            "type": "number"
          },
          "model": {
            "type": "string"
          },
          "promptTokens": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AICreditUsageSummaryPublic": {
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/AICreditUsageSummaryTotals"
          },
          "yearMonth": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AICreditUsageSummaryTotals": {
        "properties": {
          "adjusted": {
            "type": "number"
          },
          "deposited": {
            "type": "number"
          },
          "granted": {
            "type": "number"
          },
          "used": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "APIKey": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "lastUsedAt": {
            "type": "string"
          },
          "lastUsedIp": {
            "type": "string"
          },
          "lastUsedUserAgent": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "revokedAt": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/APIKeyScope"
          },
          "serviceAccountId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "APIKeyScope": {
        "enum": ["read", "read-write"],
        "type": "string",
        "x-enum-varnames": ["APIKeyScopeRead", "APIKeyScopeReadWrite"]
      },
      "APIRequestAudit": {
        "properties": {
          "apiKeyId": {
            "type": "string"
          },
          "clientIp": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "principalId": {
            "type": "string"
          },
          "principalType": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "routePattern": {
            "type": "string"
          },
          "serviceAccountId": {
            "type": "string"
          },
          "statusCode": {
            "type": "integer"
          },
          "userAgent": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ActionDefinition": {
        "properties": {
          "category": {
            "description": "Action category (e.g., \"Blockchain\", \"Social\")",
            "type": "string"
          },
          "connector": {
            "$ref": "#/components/schemas/ConnectorRequirement"
          },
          "connectorOutput": {
            "$ref": "#/components/schemas/ConnectorOutput"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "directExecutable": {
            "description": "Caddie one-shot direct execution eligibility (B3-4431)",
            "type": "boolean"
          },
          "documentationUrl": {
            "type": "string"
          },
          "exampleInput": {
            "description": "Example input for documentation"
          },
          "exampleOutput": {},
          "fundsMovement": {
            "description": "Opaque pass-through from b3os-actions",
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "gasChainField": {
            "description": "Payload field whose value is the gas-paying chain ID (dynamic; consulted when GasChainID is 0). E.g. \"srcChainId\" for cross-chain actions where the user signs and pays gas on the source chain.",
            "type": "string"
          },
          "gasChainId": {
            "description": "Chain ID where gas is needed (static)",
            "type": "integer"
          },
          "logoUrl": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "payloadSchema": {
            "$ref": "#/components/schemas/OrderedSchema"
          },
          "platform": {
            "description": "Platform grouping for integrations page (e.g., \"solana\")",
            "type": "string"
          },
          "requiredTokens": {
            "description": "Opaque pass-through from b3os-actions",
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "requiresGas": {
            "description": "Whether action requires gas (blockchain transaction fees)",
            "type": "boolean"
          },
          "resultSchema": {
            "$ref": "#/components/schemas/OrderedSchema"
          },
          "tags": {
            "description": "Tags for filtering",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "test": {
            "$ref": "#/components/schemas/TestConfig"
          },
          "type": {
            "type": "string"
          },
          "weight": {
            "description": "Search ranking weight (nil = default 50)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AuditFinding": {
        "properties": {
          "acknowledged": {
            "type": "boolean"
          },
          "category": {
            "description": "reentrancy, access-control, etc.",
            "type": "string"
          },
          "codeSnippet": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "recommendation": {
            "type": "string"
          },
          "severity": {
            "description": "critical, high, medium, low, info",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuditReport": {
        "properties": {
          "findings": {
            "items": {
              "$ref": "#/components/schemas/AuditFinding"
            },
            "type": "array",
            "uniqueItems": false
          },
          "passes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "summary": {
            "$ref": "#/components/schemas/AuditSummary"
          },
          "timestamp": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuditSummary": {
        "properties": {
          "critical": {
            "type": "integer"
          },
          "high": {
            "type": "integer"
          },
          "info": {
            "type": "integer"
          },
          "low": {
            "type": "integer"
          },
          "medium": {
            "type": "integer"
          },
          "overallRisk": {
            "description": "low, medium, high, critical",
            "type": "string"
          },
          "recommendation": {
            "description": "deployment recommendation",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BlockExpansionMeta": {
        "properties": {
          "blockId": {
            "type": "string"
          },
          "blockVersion": {
            "type": "integer"
          },
          "entryNodeIds": {
            "description": "Subset of ExpandedIDs that are entry points",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "expandedIds": {
            "description": "All namespaced node IDs produced by expansion",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "outputSchema": {
            "description": "Block's output schema for reference",
            "items": {
              "$ref": "#/components/schemas/BlockOutput"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "BlockNodeContext": {
        "description": "BlockContext is set on nodes that were expanded from a block.\nIt traces the node back to its source block and carries the inputMapping\nneeded to resolve {{$inputs.key}} references at execution time.",
        "properties": {
          "blockId": {
            "description": "Block entity ID",
            "type": "string"
          },
          "blockNodeId": {
            "description": "Original block node ID in the workflow",
            "type": "string"
          },
          "blockVersion": {
            "description": "Pinned block version",
            "type": "integer"
          },
          "inputMapping": {
            "additionalProperties": {},
            "description": "From block node payload (consumer-authored)",
            "type": "object"
          }
        },
        "type": "object"
      },
      "BlockOutput": {
        "properties": {
          "description": {
            "description": "Human-readable description for the variable picker",
            "type": "string"
          },
          "key": {
            "description": "Output field name exposed to consumers",
            "type": "string"
          },
          "properties": {
            "additionalProperties": {
              "$ref": "#/components/schemas/BlockOutputProperty"
            },
            "description": "Nested schema for object/array outputs (shown in variable picker)",
            "type": "object"
          },
          "sourceField": {
            "description": "Field path from the source node's result (e.g., \"balance\")",
            "type": "string"
          },
          "sourceNode": {
            "description": "Node ID within the block definition",
            "type": "string"
          },
          "type": {
            "description": "\"string\", \"number\", \"boolean\", \"object\", \"array\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BlockOutputProperty": {
        "properties": {
          "description": {
            "type": "string"
          },
          "properties": {
            "additionalProperties": {
              "$ref": "#/components/schemas/BlockOutputProperty"
            },
            "type": "object"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CUCostActionsByCategory": {
        "properties": {
          "builtIn": {
            "items": {
              "$ref": "#/components/schemas/CUCostItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "dynamic": {
            "items": {
              "$ref": "#/components/schemas/CUCostItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "logic": {
            "items": {
              "$ref": "#/components/schemas/CUCostItem"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "CUCostDefaults": {
        "properties": {
          "builtIn": {
            "type": "number"
          },
          "dynamic": {
            "type": "number"
          },
          "logic": {
            "type": "number"
          },
          "trigger": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CUCostItem": {
        "properties": {
          "cost": {
            "type": "number"
          },
          "isStream": {
            "description": "IsStream and UptimeCu are set only on trigger items. A stream\ntrigger bills UptimeCu once per uptime interval for as long as the\nworkflow is active, on top of per-fire costs.",
            "type": "boolean"
          },
          "source": {
            "description": "\"default\" or \"override\"",
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "uptimeCu": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CUCostsResult": {
        "properties": {
          "actions": {
            "$ref": "#/components/schemas/CUCostActionsByCategory"
          },
          "defaults": {
            "$ref": "#/components/schemas/CUCostDefaults"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/CUCostItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "uptime": {
            "$ref": "#/components/schemas/CUCostsUptime"
          }
        },
        "type": "object"
      },
      "CUCostsUptime": {
        "properties": {
          "defaultCu": {
            "type": "number"
          },
          "enabled": {
            "type": "boolean"
          },
          "enrichmentCu": {
            "additionalProperties": {
              "type": "number"
            },
            "description": "EnrichmentCu maps enricher name (e.g. \"sender\", \"valueUsd\") to its\nper-interval CU cost, charged on top of the trigger's base uptime\nfor workflows that opt into the enrichment.",
            "type": "object"
          },
          "intervalMs": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CUDailyUsage": {
        "properties": {
          "breakdown": {
            "items": {
              "$ref": "#/components/schemas/CUUsageBreakdown"
            },
            "type": "array",
            "uniqueItems": false
          },
          "date": {
            "type": "string"
          },
          "used": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CUGetBalanceResult": {
        "properties": {
          "balance": {
            "type": "number"
          },
          "minThreshold": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CURunItem": {
        "properties": {
          "finishedAt": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "totalCu": {
            "type": "number"
          },
          "triggerSource": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CUUpdateThresholdResult": {
        "properties": {
          "newThreshold": {
            "type": "number"
          },
          "oldThreshold": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CUUsageBreakdown": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "cu": {
            "type": "number"
          },
          "nodeType": {
            "type": "string"
          },
          "type": {
            "description": "\"trigger\" or \"action\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CUUsageByWorkflowResult": {
        "properties": {
          "workflows": {
            "items": {
              "$ref": "#/components/schemas/CUWorkflowUsageItem"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "CUUsageSummary": {
        "properties": {
          "daily": {
            "items": {
              "$ref": "#/components/schemas/CUDailyUsage"
            },
            "type": "array",
            "uniqueItems": false
          },
          "summary": {
            "$ref": "#/components/schemas/CUUsageSummaryTotals"
          },
          "yearMonth": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CUUsageSummaryTotals": {
        "properties": {
          "adjusted": {
            "description": "Net of period adjustments (credit +, debit -, incl. monthly reset) so the\nbreakdown reconciles: granted + deposited + adjusted - used.",
            "type": "number"
          },
          "deposited": {
            "type": "number"
          },
          "granted": {
            "type": "number"
          },
          "used": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CUWorkflowUsageItem": {
        "properties": {
          "cuPerHour": {
            "type": "number"
          },
          "estimatedCostPerRun": {
            "type": "integer"
          },
          "isStream": {
            "type": "boolean"
          },
          "runCount": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "totalCu": {
            "type": "number"
          },
          "triggerType": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          },
          "workflowName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChainContext": {
        "properties": {
          "blockchain": {
            "description": "\"evm\" or \"solana\"",
            "type": "string"
          },
          "networkId": {
            "description": "\"1\", \"8453\", \"7565164\", etc.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChatMessage": {
        "properties": {
          "agentVersion": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "imageUrls": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "linkedRunFinishedAt": {
            "type": "string"
          },
          "linkedRunId": {
            "type": "string"
          },
          "linkedRunStartedAt": {
            "type": "string"
          },
          "linkedRunStatus": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "organizationId": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "senderUserId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "structuredPayload": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "tokensUsed": {
            "type": "integer"
          },
          "turnId": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ColumnSchema": {
        "properties": {
          "default": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "notNull": {
            "type": "boolean"
          },
          "primaryKey": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "unique": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Comment": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/StickyNoteUser"
          },
          "id": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/NodePosition"
          },
          "replies": {
            "items": {
              "$ref": "#/components/schemas/CommentReply"
            },
            "type": "array",
            "uniqueItems": false
          },
          "resolved": {
            "type": "boolean"
          },
          "text": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CommentReply": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/StickyNoteUser"
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Connector": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "maskedData": {
            "additionalProperties": {},
            "description": "Computed field, not persisted",
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConnectorDefinition": {
        "properties": {
          "categories": {
            "description": "Deprecated: use Tags instead",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "dataSchema": {
            "additionalProperties": {},
            "type": "object"
          },
          "defaultOnly": {
            "description": "DefaultOnly indicates that this connector type is managed entirely by the platform.\nUsers cannot create their own connector instances; actions always use platform credentials.",
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "informationUrl": {
            "type": "string"
          },
          "logoDomain": {
            "description": "Domain for logo.dev (e.g., \"slack.com\")",
            "type": "string"
          },
          "logoUrl": {
            "description": "Computed at runtime from LogoDomain",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "optional": {
            "description": "Optional indicates if the connector can be omitted when required by an action.\nIf true, workflow nodes can have a null connector and the action will execute\nwithout connector data (b3os-actions handles fallback if needed).",
            "type": "boolean"
          },
          "provider": {
            "description": "Provider indicates the underlying provider for this connector.\nFor Pipedream connectors, this is \"pipedream\".",
            "type": "string"
          },
          "providerConfig": {
            "additionalProperties": {},
            "description": "ProviderConfig contains provider-specific configuration.\nFor Pipedream connectors, this includes appSlug, authPropName, authType.",
            "type": "object"
          },
          "setupGuide": {
            "description": "SetupGuide contains markdown instructions for setting up the connector.",
            "type": "string"
          },
          "tags": {
            "description": "Tags for filtering and categorization",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConnectorOutput": {
        "description": "Auto-save result as connector",
        "properties": {
          "fieldMapping": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "resultField → connectorDataField",
            "type": "object"
          },
          "nameTemplate": {
            "description": "Display name with {{field}} interpolation (uses result field names, i.e. left side of FieldMapping)",
            "type": "string"
          },
          "type": {
            "description": "Connector type (e.g., \"railgun\")",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConnectorReference": {
        "description": "nil if action doesn't need connector",
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "walletAddress": {
            "description": "WalletAddress is the wallet's on-chain address, only meaningful for\ntype:\"wallet\" refs. Not used by ConnectorResolver (which resolves the\naddress from the wallet DB record); exists for frontend round-trip fidelity.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConnectorRequirement": {
        "description": "nil means no connector required",
        "properties": {
          "accountType": {
            "description": "Required wallet account type (e.g., \"polymarket_deposit_wallet\")",
            "type": "string"
          },
          "type": {
            "description": "Required connector type (e.g., \"slack\")",
            "type": "string"
          },
          "walletSupport": {
            "description": "Wallet account types this action supports (e.g., [\"eoa\"]). Nil = all types allowed.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "ContractPlanSummary": {
        "properties": {
          "description": {
            "type": "string"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "gasOptimizations": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "name": {
            "type": "string"
          },
          "securityConsiderations": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "ContractProject": {
        "properties": {
          "allDeployments": {
            "items": {
              "$ref": "#/components/schemas/DeployResult"
            },
            "type": "array",
            "uniqueItems": false
          },
          "auditReport": {
            "$ref": "#/components/schemas/AuditReport"
          },
          "autoFixAttempts": {
            "type": "integer"
          },
          "compilationFixAttempts": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "currentStep": {
            "type": "integer"
          },
          "deployments": {
            "$ref": "#/components/schemas/Deployments"
          },
          "externalContractId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "planSummary": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/ContractSource"
          },
          "status": {
            "$ref": "#/components/schemas/ContractProjectStatus"
          },
          "testResults": {
            "$ref": "#/components/schemas/TestResults"
          },
          "updatedAt": {
            "type": "string"
          },
          "walletId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContractProjectStatus": {
        "enum": [
          "planned",
          "generating",
          "code_generated",
          "testing",
          "tested",
          "auditing",
          "audited",
          "deploying",
          "testnet_deployed",
          "mainnet_deployed",
          "failed"
        ],
        "type": "string",
        "x-enum-comments": {
          "ContractStatusAuditing": "Intermediate status during security audit",
          "ContractStatusDeploying": "Intermediate status during deployment",
          "ContractStatusGenerating": "Intermediate status during code generation",
          "ContractStatusTesting": "Intermediate status during test execution"
        },
        "x-enum-varnames": [
          "ContractStatusPlanned",
          "ContractStatusGenerating",
          "ContractStatusCodeGenerated",
          "ContractStatusTesting",
          "ContractStatusTested",
          "ContractStatusAuditing",
          "ContractStatusAudited",
          "ContractStatusDeploying",
          "ContractStatusTestnetDeployed",
          "ContractStatusMainnetDeployed",
          "ContractStatusFailed"
        ]
      },
      "ContractSource": {
        "properties": {
          "abi": {
            "description": "Compiled artifacts (populated after compilation)",
            "type": "string"
          },
          "bytecode": {
            "description": "Deployment bytecode",
            "type": "string"
          },
          "compilerOutput": {
            "description": "Metadata",
            "type": "string"
          },
          "constructorAbi": {
            "description": "Constructor info",
            "type": "string"
          },
          "contractCode": {
            "description": "Main contract Solidity source (flattened or with imports)",
            "type": "string"
          },
          "contractName": {
            "description": "Main contract (required)",
            "type": "string"
          },
          "dependencies": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "package → version (e.g., \"@openzeppelin/contracts\" → \"v5.0.0\")",
            "type": "object"
          },
          "deployedCode": {
            "description": "Runtime bytecode",
            "type": "string"
          },
          "files": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Multi-file project support\nKey: relative path (e.g., \"src/interfaces/IERC20.sol\")\nValue: file content",
            "type": "object"
          },
          "mainContract": {
            "description": "Path to main contract file (e.g., \"src/MyToken.sol\")",
            "type": "string"
          },
          "solVersion": {
            "description": "Solidity version (e.g., \"0.8.20\")",
            "type": "string"
          },
          "summary": {
            "description": "Non-technical summary generated by AI",
            "type": "string"
          },
          "testCode": {
            "description": "Foundry test file source",
            "type": "string"
          },
          "version": {
            "description": "Source version (increments on each edit)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "DeployResult": {
        "properties": {
          "address": {
            "type": "string"
          },
          "blockNumber": {
            "type": "integer"
          },
          "chainId": {
            "type": "integer"
          },
          "deployedAt": {
            "type": "string"
          },
          "deploymentMode": {
            "description": "standard, create2, or create3",
            "type": "string"
          },
          "gasUsed": {
            "type": "integer"
          },
          "isDeterministic": {
            "description": "Whether CREATE2/CREATE3 was used",
            "type": "boolean"
          },
          "networkType": {
            "description": "mainnet or testnet",
            "type": "string"
          },
          "predictedAddress": {
            "description": "Pre-computed address for deterministic deployments",
            "type": "string"
          },
          "salt": {
            "description": "CREATE2/CREATE3 salt for deterministic address",
            "type": "string"
          },
          "txHash": {
            "type": "string"
          },
          "verificationStatus": {
            "$ref": "#/components/schemas/VerificationStatus"
          },
          "verificationUrl": {
            "description": "URL to view verified contract on block explorer",
            "type": "string"
          },
          "verified": {
            "description": "Whether contract source is verified on block explorer",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "DeploymentEstimate": {
        "properties": {
          "costUsd": {
            "type": "string"
          },
          "estimatedCost": {
            "type": "string"
          },
          "gasLimit": {
            "type": "integer"
          },
          "gasPrice": {
            "type": "string"
          },
          "maxFeePerGas": {
            "type": "string"
          },
          "warning": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Deployments": {
        "additionalProperties": {
          "$ref": "#/components/schemas/DeployResult"
        },
        "description": "Deployments is populated from the contract_deployments table, NOT from a DB column.\nKept for backward-compatible JSON serialization in API responses.",
        "type": "object"
      },
      "ExecutionContext": {
        "properties": {
          "chainContext": {
            "$ref": "#/components/schemas/ChainContext"
          },
          "inputs": {
            "additionalProperties": {},
            "description": "Block input values ({{$inputs.key}})",
            "type": "object"
          },
          "loopVars": {
            "additionalProperties": {},
            "description": "Loop variables (for for-each nodes)",
            "type": "object"
          },
          "props": {
            "additionalProperties": {},
            "description": "Template prop values snapshot",
            "type": "object"
          },
          "workflowId": {
            "description": "Current workflow ID ({{$workflowId}})",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExecutionNode": {
        "properties": {
          "connector": {
            "additionalProperties": {},
            "description": "Safe connector metadata (e.g., wallet address)",
            "type": "object"
          },
          "context": {
            "$ref": "#/components/schemas/ExecutionContext"
          },
          "finishedAt": {
            "type": "string"
          },
          "input": {
            "additionalProperties": {},
            "description": "Input payload at time of completion/failure (may be raw or resolved)",
            "type": "object"
          },
          "iterations": {
            "description": "For for-each nodes only: tracks execution state of each iteration.\nEach iteration is a mini ExecutionState graph (nodeID → ExecutionNode).",
            "items": {
              "additionalProperties": {
                "$ref": "#/components/schemas/ExecutionNode"
              },
              "type": "object"
            },
            "type": "array",
            "uniqueItems": false
          },
          "result": {
            "additionalProperties": {},
            "description": "Output from execution",
            "type": "object"
          },
          "secretKeys": {
            "description": "Input keys that contain connector secrets (for masking)",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ExecutionNodeStatus"
          },
          "type": {
            "description": "Node type (e.g., \"webhook\", \"send-erc20-token\")",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExecutionNodeStatus": {
        "enum": [
          "pending",
          "running",
          "success",
          "partial",
          "failure",
          "skipped",
          "waiting",
          "scheduled",
          "cancelled",
          "auto_swapping"
        ],
        "type": "string",
        "x-enum-comments": {
          "ExecutionNodeStatusAutoSwapping": "Set when auto-swap is executing to cover a balance deficit",
          "ExecutionNodeStatusCancelled": "Set when run is cancelled by user",
          "ExecutionNodeStatusFailure": "Set when node execution fails",
          "ExecutionNodeStatusPartial": "Set when a for-each node completes with mixed iteration outcomes (some succeeded, some failed)",
          "ExecutionNodeStatusPending": "Set when run is created (all non-root nodes start as pending)",
          "ExecutionNodeStatusRunning": "Set when node execution begins",
          "ExecutionNodeStatusScheduled": "Set when node is scheduled for future execution",
          "ExecutionNodeStatusSkipped": "Set when node is skipped (e.g., non-taken if branch)",
          "ExecutionNodeStatusSuccess": "Set when node execution completes successfully",
          "ExecutionNodeStatusWaiting": "Set when node is paused waiting for a trigger"
        },
        "x-enum-varnames": [
          "ExecutionNodeStatusPending",
          "ExecutionNodeStatusRunning",
          "ExecutionNodeStatusSuccess",
          "ExecutionNodeStatusPartial",
          "ExecutionNodeStatusFailure",
          "ExecutionNodeStatusSkipped",
          "ExecutionNodeStatusWaiting",
          "ExecutionNodeStatusScheduled",
          "ExecutionNodeStatusCancelled",
          "ExecutionNodeStatusAutoSwapping"
        ]
      },
      "ExecutionSourceSystemStat": {
        "properties": {
          "cancelled": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          },
          "sourceSystem": {
            "type": "string"
          },
          "succeeded": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ExecutionStatsSummary": {
        "properties": {
          "averageDurationMs": {
            "type": "number"
          },
          "cancelled": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "inProgress": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          },
          "succeeded": {
            "type": "integer"
          },
          "successRate": {
            "type": "number"
          },
          "terminal": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ExecutionStatusCount": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/ExternalExecutionStatus"
          }
        },
        "type": "object"
      },
      "ExecutionTimeSeriesPoint": {
        "properties": {
          "bucketStart": {
            "type": "string"
          },
          "cancelled": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          },
          "succeeded": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ExecutionWebhookDelivery": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer"
          },
          "endpointId": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "executionId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "maxRetries": {
            "type": "integer"
          },
          "nextRetryAt": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "requestBody": {
            "additionalProperties": {},
            "type": "object"
          },
          "requestHeaders": {
            "additionalProperties": {},
            "type": "object"
          },
          "responseBody": {
            "type": "string"
          },
          "responseHeaders": {
            "additionalProperties": {},
            "type": "object"
          },
          "responseStatus": {
            "type": "integer"
          },
          "retryCount": {
            "type": "integer"
          },
          "runId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ExecutionWebhookDeliveryStatus"
          },
          "updatedAt": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExecutionWebhookDeliveryStatus": {
        "enum": ["pending", "success", "failure", "retrying"],
        "type": "string",
        "x-enum-varnames": [
          "ExecutionWebhookDeliveryStatusPending",
          "ExecutionWebhookDeliveryStatusSuccess",
          "ExecutionWebhookDeliveryStatusFailure",
          "ExecutionWebhookDeliveryStatusRetrying"
        ]
      },
      "ExecutionWebhookEndpoint": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "disabledAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "maxRetries": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ExecutionWebhookEndpointStatus"
          },
          "subscribedEventTypes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExecutionWebhookEndpointStatus": {
        "enum": ["active", "disabled"],
        "type": "string",
        "x-enum-varnames": [
          "ExecutionWebhookEndpointStatusActive",
          "ExecutionWebhookEndpointStatusDisabled"
        ]
      },
      "ExternalExecution": {
        "properties": {
          "checkoutSessionId": {
            "type": "string"
          },
          "clientSafeMetadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "createdAt": {
            "type": "string"
          },
          "externalRef": {
            "type": "string"
          },
          "finishedAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "initiatedById": {
            "type": "string"
          },
          "initiatedByType": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string"
          },
          "requestPayload": {
            "additionalProperties": {},
            "type": "object"
          },
          "responsePayload": {
            "additionalProperties": {},
            "type": "object"
          },
          "runId": {
            "type": "string"
          },
          "sourceEntityId": {
            "type": "string"
          },
          "sourceEntityType": {
            "type": "string"
          },
          "sourceSystem": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ExternalExecutionStatus"
          },
          "statusReason": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExternalExecutionEvent": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "data": {
            "additionalProperties": {},
            "type": "object"
          },
          "eventType": {
            "type": "string"
          },
          "executionId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExternalExecutionStatus": {
        "enum": [
          "awaiting_payment",
          "payment_confirmed",
          "workflow_queued",
          "workflow_running",
          "workflow_waiting",
          "workflow_succeeded",
          "workflow_partial",
          "workflow_failed",
          "workflow_cancelled"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ExternalExecutionStatusAwaitingPayment",
          "ExternalExecutionStatusPaymentConfirmed",
          "ExternalExecutionStatusWorkflowQueued",
          "ExternalExecutionStatusWorkflowRunning",
          "ExternalExecutionStatusWorkflowWaiting",
          "ExternalExecutionStatusWorkflowSucceeded",
          "ExternalExecutionStatusWorkflowPartial",
          "ExternalExecutionStatusWorkflowFailed",
          "ExternalExecutionStatusWorkflowCancelled"
        ]
      },
      "FailureRateStats": {
        "properties": {
          "failed": {
            "type": "integer"
          },
          "failureRate": {
            "description": "percentage (0-100)",
            "type": "number"
          },
          "partial": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ForEachContext": {
        "properties": {
          "index": {
            "type": "integer"
          },
          "parentNodeId": {
            "description": "Legacy fields kept for backward-compatible JSON deserialization.\nNew code should only use Stack.",
            "type": "string"
          },
          "stack": {
            "description": "Stack holds nesting levels from outermost to innermost.\nSingle-level for-each uses a stack of length 1.",
            "items": {
              "$ref": "#/components/schemas/ForEachLevel"
            },
            "type": "array",
            "uniqueItems": false
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ForEachLevel": {
        "properties": {
          "index": {
            "description": "Current iteration index (0, 1, 2...)",
            "type": "integer"
          },
          "parentNodeId": {
            "description": "For-each node ID (e.g., \"for_each_send\")",
            "type": "string"
          },
          "total": {
            "description": "Total iterations (for progress tracking)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "InviteStatus": {
        "enum": ["pending", "accepted", "declined", "expired"],
        "type": "string",
        "x-enum-varnames": [
          "InviteStatusPending",
          "InviteStatusAccepted",
          "InviteStatusDeclined",
          "InviteStatusExpired"
        ]
      },
      "InviteWithOrgName": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invitedBy": {
            "type": "string"
          },
          "inviteeEmail": {
            "type": "string"
          },
          "inviteeUserId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "status": {
            "$ref": "#/components/schemas/InviteStatus"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LatencyTimeSeriesPoint": {
        "properties": {
          "avgLatencyMs": {
            "description": "Average latency in this bucket",
            "type": "number"
          },
          "bucketStart": {
            "description": "Start of time bucket (hourly or daily)",
            "type": "string"
          },
          "p50LatencyMs": {
            "description": "Median latency (50th percentile)",
            "type": "number"
          },
          "p95LatencyMs": {
            "description": "95th percentile latency",
            "type": "number"
          }
        },
        "type": "object"
      },
      "NodePosition": {
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "NodeStatistics": {
        "properties": {
          "averageLatencyMs": {
            "description": "For actions only (nil for triggers)",
            "type": "number"
          },
          "nodeId": {
            "type": "string"
          },
          "nodeType": {
            "type": "string"
          },
          "successRate": {
            "description": "For actions only (nil for triggers)",
            "type": "number"
          },
          "totalExecutions": {
            "description": "From continuous aggregate",
            "type": "integer"
          },
          "workflowsCount": {
            "description": "From workflows table (direct query)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "OrderedSchema": {
        "description": "Separate schema for wait-for-trigger config",
        "type": "object"
      },
      "OrgAutoSwapSettings": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "maxSwapAmountUsd": {
            "description": "MaxSwapAmountUsd caps the output USD value per individual swap.\nZero means no limit. Default is $3. Prevents a misconfigured action\nfrom draining the entire source wallet in a single swap.",
            "type": "number"
          },
          "mode": {
            "description": "Mode controls how sources are selected. See AutoSwapMode* constants.\nDefaults to AutoSwapModeAutoLowestBalance for new orgs.",
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/OrgAutoSwapSource"
            },
            "type": "array",
            "uniqueItems": false
          },
          "updatedAt": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrgAutoSwapSource": {
        "properties": {
          "chainId": {
            "description": "ChainID is the source chain to sell from.",
            "type": "integer"
          },
          "id": {
            "description": "ID is a unique identifier for this source (e.g., \"src_abc123\").",
            "type": "string"
          },
          "priority": {
            "description": "Priority controls order of evaluation (lower = tried first).",
            "type": "integer"
          },
          "slippageBps": {
            "description": "SlippageBps is the slippage tolerance in basis points. Default 300 (3%).",
            "type": "integer"
          },
          "tokenAddress": {
            "description": "TokenAddress is the token to sell. Use \"native\" for native gas tokens.",
            "type": "string"
          },
          "tokenDecimals": {
            "description": "TokenDecimals is the number of decimal places for the token (e.g. 18 for ETH, 6 for USDC).\nStored so the UI can display the human-readable amount without re-fetching on-chain metadata.",
            "type": "integer"
          },
          "walletId": {
            "description": "WalletID is the org wallet to sell from.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Organization": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "cuMinThreshold": {
            "type": "number"
          },
          "deletedAt": {
            "type": "string"
          },
          "deletedBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "photo": {
            "description": "IPFS URL or HTTP URL",
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrganizationInvite": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invitedBy": {
            "type": "string"
          },
          "inviteeEmail": {
            "type": "string"
          },
          "inviteeUserId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "status": {
            "$ref": "#/components/schemas/InviteStatus"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrganizationMember": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invitedBy": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "updatedAt": {
            "type": "string"
          },
          "userEmail": {
            "description": "UserEmail is resolved from B3 API at response time and not persisted.",
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrganizationMetadata": {
        "properties": {
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "photo": {
            "description": "IPFS URL or HTTP URL",
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrganizationRole": {
        "enum": ["owner", "developer"],
        "type": "string",
        "x-enum-varnames": ["OrgRoleOwner", "OrgRoleDeveloper"]
      },
      "OrganizationWallet": {
        "properties": {
          "accountType": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string"
          },
          "deletedBy": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "isImported": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "providerConfig": {
            "additionalProperties": {},
            "type": "object"
          },
          "providerType": {
            "type": "string"
          },
          "providerWalletId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OutboundWebhookDelivery": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer"
          },
          "errorMessage": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "maxRetries": {
            "type": "integer"
          },
          "method": {
            "type": "string"
          },
          "nextRetryAt": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "requestBody": {
            "additionalProperties": {},
            "type": "object"
          },
          "requestHeaders": {
            "additionalProperties": {},
            "type": "object"
          },
          "responseBody": {
            "type": "string"
          },
          "responseHeaders": {
            "additionalProperties": {},
            "type": "object"
          },
          "responseStatus": {
            "type": "integer"
          },
          "retryCount": {
            "type": "integer"
          },
          "runId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OutboundWebhookDeliveryStatus"
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OutboundWebhookDeliveryStatus": {
        "enum": ["pending", "success", "failure", "retrying"],
        "type": "string",
        "x-enum-varnames": [
          "OutboundWebhookStatusPending",
          "OutboundWebhookStatusSuccess",
          "OutboundWebhookStatusFailure",
          "OutboundWebhookStatusRetrying"
        ]
      },
      "ParamDefinition": {
        "properties": {
          "default": {
            "description": "Default value (used if not provided at runtime)"
          },
          "description": {
            "description": "Human-readable description",
            "type": "string"
          },
          "enum": {
            "description": "Validation hints (optional)",
            "items": {},
            "type": "array",
            "uniqueItems": false
          },
          "items": {
            "additionalProperties": {},
            "description": "For complex types",
            "type": "object"
          },
          "maxLength": {
            "description": "Max length for strings",
            "type": "integer"
          },
          "maximum": {
            "description": "Maximum for numbers",
            "type": "integer"
          },
          "minLength": {
            "description": "Min length for strings",
            "type": "integer"
          },
          "minimum": {
            "description": "Minimum for numbers",
            "type": "integer"
          },
          "pattern": {
            "description": "Regex pattern for strings",
            "type": "string"
          },
          "properties": {
            "additionalProperties": {},
            "description": "Object properties",
            "type": "object"
          },
          "required": {
            "description": "Whether this param is required",
            "type": "boolean"
          },
          "type": {
            "description": "string, number, integer, boolean, array, object",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PausedReason": {
        "enum": [
          "cu_exhausted",
          "disabled_action",
          "consecutive_failures",
          "max_runs_exhausted",
          "invalid_chat",
          "member_removed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "PausedReasonCUExhausted",
          "PausedReasonDisabledAction",
          "PausedReasonConsecutiveFailures",
          "PausedReasonMaxRunsExhausted",
          "PausedReasonInvalidChat",
          "PausedReasonMemberRemoved"
        ]
      },
      "Permission": {
        "enum": [
          "org:read",
          "org:update",
          "org:delete",
          "member:invite",
          "member:remove",
          "member:update_role",
          "workflow:create",
          "workflow:read",
          "workflow:update",
          "workflow:delete",
          "workflow:execute",
          "workflow:publish",
          "connector:create",
          "connector:read",
          "connector:update",
          "connector:delete",
          "action:read",
          "run:read",
          "run:stream",
          "run:cancel",
          "execution:read",
          "execution:stream",
          "execution:webhook",
          "restriction:read",
          "restriction:update",
          "ai:chat",
          "wallet:withdraw",
          "action_proxy:execute",
          "apikey:create",
          "apikey:read",
          "apikey:revoke",
          "service_account:read",
          "service_account:write",
          "stats:read",
          "database:read",
          "database:update"
        ],
        "type": "string",
        "x-enum-varnames": [
          "PermissionOrgRead",
          "PermissionOrgUpdate",
          "PermissionOrgDelete",
          "PermissionMemberInvite",
          "PermissionMemberRemove",
          "PermissionMemberUpdateRole",
          "PermissionWorkflowCreate",
          "PermissionWorkflowRead",
          "PermissionWorkflowUpdate",
          "PermissionWorkflowDelete",
          "PermissionWorkflowExecute",
          "PermissionWorkflowPublish",
          "PermissionConnectorCreate",
          "PermissionConnectorRead",
          "PermissionConnectorUpdate",
          "PermissionConnectorDelete",
          "PermissionActionRead",
          "PermissionRunRead",
          "PermissionRunStream",
          "PermissionRunCancel",
          "PermissionExecutionRead",
          "PermissionExecutionStream",
          "PermissionExecutionWebhook",
          "PermissionRestrictionRead",
          "PermissionRestrictionUpdate",
          "PermissionAIChat",
          "PermissionWalletWithdraw",
          "PermissionActionProxyExecute",
          "PermissionAPIKeyCreate",
          "PermissionAPIKeyRead",
          "PermissionAPIKeyRevoke",
          "PermissionServiceAccountRead",
          "PermissionServiceAccountWrite",
          "PermissionStatsRead",
          "PermissionOrgDatabaseRead",
          "PermissionOrgDatabaseUpdate"
        ]
      },
      "PropColumn": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "chainPropKey": {
            "description": "For tokenAmount cells",
            "type": "string"
          },
          "inputType": {
            "description": "address, recipientAddress, tokenAmount, text (see frontend CELL_REGISTRY)",
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "tokenAddress": {
            "type": "string"
          },
          "tokenAddressPropKey": {
            "description": "For tokenAmount cells",
            "type": "string"
          },
          "type": {
            "description": "\"string\", \"number\", \"integer\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PropSchema": {
        "properties": {
          "accountType": {
            "description": "AccountType filters the wallet picker by account type on\ninputType=\"walletConnector\" fields (e.g. \"polymarket_deposit_wallet\").",
            "type": "string"
          },
          "allowWalletPicker": {
            "description": "AllowWalletPicker controls the org-wallet picker on inputType=\"address\"\nfields. When false, the frontend hides the inline \"Wallets\" badge and\nthe org-wallet autocomplete popover. Use for third-party address fields\n(e.g. a deployer filter) where suggesting org wallets is misleading.\nPointer so explicit false survives JSON round-trip (default true on FE).",
            "type": "boolean"
          },
          "allowedChannels": {
            "description": "AllowedChannels constrains the notification-channel picker\n(inputType: \"notification-channel\") to a subset of channels. Used by\ntemplates whose downstream nodes only work with one channel type\n(e.g. [\"slack\"] for a Slack-only approval flow). Frontend ignores\nunknown keys; a length-1 list auto-selects in the picker.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "autoFillFromWallet": {
            "description": "AutoFillFromWallet, when true, auto-fills this prop with the selected\nworkflow wallet address and hides it from the form. Pointer so an\nexplicit false survives the JSON round-trip (same rationale as\nAllowWalletPicker).",
            "type": "boolean"
          },
          "bindsConnectorNodes": {
            "description": "BindsConnectorNodes lists workflow node IDs whose wallet-type connector\nshould be prefilled from this prop's picked wallet (inputType:\n\"walletConnector\"). The connector stays a plain, editable connector —\nthis is a prefill, not a permanent bind.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "chainId": {
            "description": "For tokenAmount: hardcoded chain ID",
            "type": "integer"
          },
          "chainPropKey": {
            "description": "For tokenSelector/tokenAmount: prop key providing chainId",
            "type": "string"
          },
          "columns": {
            "description": "Columns describes a csvTable prop (inputType: \"csvTable\"). The stored\nvalue is an object-of-columnar-arrays: {colKey: []value}. Payload\ntemplates reference each column via {{$props.<propKey>.<colKey>}}.",
            "items": {
              "$ref": "#/components/schemas/PropColumn"
            },
            "type": "array",
            "uniqueItems": false
          },
          "dex": {
            "description": "For hyperliquidAsset: hardcoded DEX name (fallback when no dexPropKey)",
            "type": "string"
          },
          "dexPropKey": {
            "description": "For hyperliquidAsset: prop key providing HIP-3 DEX name",
            "type": "string"
          },
          "enum": {
            "items": {},
            "type": "array",
            "uniqueItems": false
          },
          "enumLabels": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "excludeNative": {
            "description": "For tokenSelector/multiTokenSelector: hide native tokens (field only accepts ERC-20 contract addresses)",
            "type": "boolean"
          },
          "groupKey": {
            "description": "Groups related props for unified UI rendering",
            "type": "string"
          },
          "inputType": {
            "description": "InputType is a UI rendering hint. The frontend uses it to pick a rich\nselector component instead of a plain text input. Unknown values are\nsilently ignored (falls back to default input).\nValid values: chainSelector, tokenSelector, multiTokenSelector, tokenAmount,\ncoinSelector, multiCoinSelector, address, contractAddress, recipientAddress,\nemail, telegram-chat, slack-channel, pushover-recipient, pushbullet-device,\nwebpush-subscription, textarea, password, polymarketUser, twitterUsername,\nstorkAsset, hyperliquidAsset, morphoVault, morphoMarket, csvTable,\nnotification-channel, googleSheetUrl, rrule, walletConnector",
            "type": "string"
          },
          "maxRows": {
            "description": "csvTable: maximum allowed rows (0 = no cap)",
            "type": "integer"
          },
          "maximum": {
            "type": "number"
          },
          "minRows": {
            "description": "csvTable: minimum required rows (0 = default 1)",
            "type": "integer"
          },
          "minimum": {
            "type": "number"
          },
          "pattern": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "showWalletBalances": {
            "description": "For tokenSelector: show wallet balances (useful for \"sell\" tokens)",
            "type": "boolean"
          },
          "sources": {
            "description": "Sources lists the workflow node fields this prop was created from.\nEach entry identifies a node + field path so the frontend can\nreliably match props back to their source fields on reload.\nMultiple entries indicate the prop was merged from fields with\nidentical values across different nodes.",
            "items": {
              "$ref": "#/components/schemas/PropSource"
            },
            "type": "array",
            "uniqueItems": false
          },
          "summary": {
            "$ref": "#/components/schemas/PropSchemaSummary"
          },
          "tokenAddress": {
            "description": "For tokenAmount: hardcoded token address",
            "type": "string"
          },
          "tokenAddressPropKey": {
            "description": "For tokenAmount: prop key providing tokenAddress",
            "type": "string"
          },
          "visibleWhen": {
            "$ref": "#/components/schemas/PropVisibleWhen"
          }
        },
        "type": "object"
      },
      "PropSchemaSummary": {
        "description": "Summary drives the csvTable footer summary. Nil means no summary is\nrendered. See PropSchemaSummary for details.",
        "properties": {
          "aggregates": {
            "description": "Aggregates declared in display order, left-to-right.",
            "items": {
              "$ref": "#/components/schemas/PropSchemaSummaryAggregate"
            },
            "type": "array",
            "uniqueItems": false
          },
          "position": {
            "description": "Position in the grid. \"footer\" (default) renders inline under the\ntable. \"none\" suppresses even when aggregates are declared — use to\ndisable inherited summaries. Other values reserved.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PropSchemaSummaryAggregate": {
        "properties": {
          "column": {
            "description": "Column key in PropSchema.Columns.",
            "type": "string"
          },
          "label": {
            "description": "Optional override for the displayed label. If empty, the frontend\nderives a label from the column + reducer (e.g. \"Total amount\").",
            "type": "string"
          },
          "reduce": {
            "description": "Reducer name. Matches the key in the frontend cell-spec's\n`aggregate` map (currently: \"sum\", \"count\"). Unknown reducers are\nsilently skipped on the frontend.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PropSource": {
        "properties": {
          "fieldPath": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "nodeLabel": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PropVisibleWhen": {
        "description": "VisibleWhen controls conditional visibility: show this prop only when\nthe referenced prop has the specified value.",
        "properties": {
          "propKey": {
            "type": "string"
          },
          "value": {}
        },
        "type": "object"
      },
      "PublicWidgetConfig": {
        "properties": {
          "buttonLabel": {
            "description": "ButtonLabel is the text displayed on the trigger button",
            "type": "string"
          },
          "description": {
            "description": "Description explains what the workflow does",
            "type": "string"
          },
          "enabled": {
            "description": "Enabled controls whether the public widget is active",
            "type": "boolean"
          },
          "maxAmount": {
            "description": "MaxAmount is the maximum amount allowed per trigger (in smallest unit)",
            "type": "string"
          },
          "minAmount": {
            "description": "MinAmount is the minimum amount required to trigger (in smallest unit)",
            "type": "string"
          },
          "title": {
            "description": "Title is the display title for the widget",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RecentExecutionFailure": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "executionId": {
            "type": "string"
          },
          "finishedAt": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "sourceSystem": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ExternalExecutionStatus"
          },
          "statusReason": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RecentRun": {
        "properties": {
          "durationMs": {
            "type": "number"
          },
          "error": {
            "type": "string"
          },
          "finishedAt": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "workflowId": {
            "type": "string"
          },
          "workflowName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Run": {
        "properties": {
          "executionState": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ExecutionNode"
            },
            "type": "object"
          },
          "finishedAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isDustTest": {
            "type": "boolean"
          },
          "isSimulation": {
            "type": "boolean"
          },
          "organizationId": {
            "type": "string"
          },
          "propValues": {
            "additionalProperties": {},
            "type": "object"
          },
          "simulationForks": {
            "items": {
              "$ref": "#/components/schemas/SimulationFork"
            },
            "type": "array",
            "uniqueItems": false
          },
          "simulationMode": {
            "type": "string"
          },
          "sourceRunId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "summary": {
            "type": "string"
          },
          "totalCu": {
            "description": "Not a column; populated by service",
            "type": "number"
          },
          "triggerNodeId": {
            "type": "string"
          },
          "triggerSource": {
            "type": "string"
          },
          "triggeredBy": {
            "type": "string"
          },
          "workflowDefinition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "workflowId": {
            "type": "string"
          },
          "workflowOwnerUserId": {
            "type": "string"
          },
          "workflowVersion": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RunListItem": {
        "properties": {
          "finishedAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isDustTest": {
            "type": "boolean"
          },
          "isSimulation": {
            "type": "boolean"
          },
          "sourceRunId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "summary": {
            "type": "string"
          },
          "totalCu": {
            "type": "number"
          },
          "triggerNodeId": {
            "type": "string"
          },
          "triggerSource": {
            "type": "string"
          },
          "triggeredBy": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          },
          "workflowName": {
            "type": "string"
          },
          "workflowVersion": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RunStatus": {
        "enum": [
          "running",
          "waiting",
          "success",
          "partial",
          "failure",
          "cancelled"
        ],
        "type": "string",
        "x-enum-comments": {
          "RunStatusCancelled": "Run was cancelled by user",
          "RunStatusFailure": "Run failed",
          "RunStatusPartial": "Run completed with mixed for-each iteration outcomes",
          "RunStatusRunning": "Run is executing",
          "RunStatusSuccess": "Run completed successfully",
          "RunStatusWaiting": "Run is paused, waiting for a trigger to resume"
        },
        "x-enum-varnames": [
          "RunStatusRunning",
          "RunStatusWaiting",
          "RunStatusSuccess",
          "RunStatusPartial",
          "RunStatusFailure",
          "RunStatusCancelled"
        ]
      },
      "RunsTimeSeriesPoint": {
        "properties": {
          "bucketStart": {
            "type": "string"
          },
          "failure": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          },
          "success": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SMSVerifiedNumber": {
        "properties": {
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "verifiedAt": {
            "type": "string"
          },
          "verifiedBy": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SeoFAQ": {
        "properties": {
          "answer": {
            "type": "string"
          },
          "question": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SeoIntegrationPage": {
        "properties": {
          "appSlugs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "contentStatus": {
            "type": "string"
          },
          "createdAt": {
            "description": "Timestamps.",
            "type": "string"
          },
          "faqs": {
            "items": {
              "$ref": "#/components/schemas/SeoFAQ"
            },
            "type": "array",
            "uniqueItems": false
          },
          "heroDescription": {
            "description": "AI-generated content.",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "integrationStatus": {
            "description": "Status tracking.",
            "type": "string"
          },
          "isPublished": {
            "type": "boolean"
          },
          "keywords": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "metaDescription": {
            "type": "string"
          },
          "pageType": {
            "type": "string"
          },
          "requestCount": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "description": "SEO metadata.",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "useCases": {
            "items": {
              "$ref": "#/components/schemas/SeoUseCase"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "SeoUseCase": {
        "properties": {
          "description": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ServiceAccount": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "disabledAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/Permission"
            },
            "type": "array",
            "uniqueItems": false
          },
          "status": {
            "$ref": "#/components/schemas/ServiceAccountStatus"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ServiceAccountStatus": {
        "enum": ["active", "disabled"],
        "type": "string",
        "x-enum-varnames": [
          "ServiceAccountStatusActive",
          "ServiceAccountStatusDisabled"
        ]
      },
      "SimulationFork": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "forkId": {
            "type": "string"
          },
          "rpcUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StickyNote": {
        "properties": {
          "color": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/StickyNoteUser"
          },
          "id": {
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/NodePosition"
          },
          "size": {
            "$ref": "#/components/schemas/StickyNoteSize"
          },
          "text": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "zIndex": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "StickyNoteSize": {
        "properties": {
          "height": {
            "type": "number"
          },
          "width": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "StickyNoteUser": {
        "properties": {
          "clientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TableSchema": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnSchema"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "Tag": {
        "properties": {
          "categories": {
            "description": "e.g., [\"blockchain\", \"finance\"]",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "count": {
            "description": "Scope-dependent: template, action, trigger, or connector count",
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "promotedTemplateCount": {
            "type": "integer"
          },
          "publicTemplateCount": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "weight": {
            "description": "Higher weight = more prominent",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TelegramVerifiedChat": {
        "properties": {
          "appKind": {
            "type": "string"
          },
          "chatId": {
            "type": "integer"
          },
          "chatTitle": {
            "type": "string"
          },
          "chatType": {
            "type": "string"
          },
          "chatUsername": {
            "type": "string"
          },
          "connectorId": {
            "type": "string"
          },
          "connectorName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "verifiedAt": {
            "type": "string"
          },
          "verifiedBy": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Template": {
        "properties": {
          "archived": {
            "type": "boolean"
          },
          "category": {
            "description": "Deprecated: Use Tags instead",
            "type": "string"
          },
          "cooldownMs": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "type": "string"
          },
          "forkCount": {
            "type": "integer"
          },
          "generatedAppId": {
            "description": "Generated-app attachment (nil when the template ships no app). On\nadoption the referenced app is CLONED into the adopting org's new\nworkflow. GeneratedAppVersionID optionally pins a specific version\nwhose manifest is used as the clone source.",
            "type": "string"
          },
          "generatedAppVersionId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isPromoted": {
            "type": "boolean"
          },
          "maxRuns": {
            "type": "integer"
          },
          "moderationStatus": {
            "$ref": "#/components/schemas/TemplateModerationStatus"
          },
          "name": {
            "type": "string"
          },
          "organizationDescription": {
            "type": "string"
          },
          "organizationId": {
            "description": "Fields for user-generated templates (nil for built-in templates)",
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          },
          "organizationPhoto": {
            "type": "string"
          },
          "promotedAt": {
            "type": "string"
          },
          "promotedBy": {
            "type": "string"
          },
          "promotedOrder": {
            "type": "integer"
          },
          "rejectionReason": {
            "type": "string"
          },
          "reviewedAt": {
            "type": "string"
          },
          "reviewedBy": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "sourceWorkflowId": {
            "description": "Source workflow link (nil for built-in or legacy templates)",
            "type": "string"
          },
          "submittedAt": {
            "type": "string"
          },
          "tableSchemas": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TableSchema"
            },
            "type": "object"
          },
          "tags": {
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": "array",
            "uniqueItems": false
          },
          "templateProps": {
            "items": {
              "$ref": "#/components/schemas/TemplateProp"
            },
            "type": "array",
            "uniqueItems": false
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          },
          "updatedAt": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "visibility": {
            "$ref": "#/components/schemas/TemplateVisibility"
          }
        },
        "type": "object"
      },
      "TemplateModerationStatus": {
        "description": "Moderation fields (B3-4168). Only meaningful for public templates;\norg templates are always approved.",
        "enum": ["pending", "approved", "rejected"],
        "type": "string",
        "x-enum-varnames": [
          "TemplateModerationStatusPending",
          "TemplateModerationStatusApproved",
          "TemplateModerationStatusRejected"
        ]
      },
      "TemplateProp": {
        "properties": {
          "default": {},
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "properties": {
            "$ref": "#/components/schemas/PropSchema"
          },
          "required": {
            "type": "boolean"
          },
          "sensitive": {
            "type": "boolean"
          },
          "type": {
            "description": "\"string\", \"number\", \"integer\", \"boolean\", \"object\" (for csvTable)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateStats": {
        "properties": {
          "activeWorkflows": {
            "type": "integer"
          },
          "avgExecutionTimeMs": {
            "type": "number"
          },
          "recentDeployments": {
            "type": "integer"
          },
          "successRate": {
            "type": "number"
          },
          "totalDeployments": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TemplateVisibility": {
        "enum": ["org", "public", "org", "public"],
        "type": "string",
        "x-enum-comments": {
          "TemplateVisibilityOrg": "Only visible to organization members",
          "TemplateVisibilityPublic": "Visible to everyone"
        },
        "x-enum-varnames": ["TemplateVisibilityOrg", "TemplateVisibilityPublic"]
      },
      "TestConfig": {
        "description": "nil means testable (default)",
        "properties": {
          "disabledReason": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TestResults": {
        "properties": {
          "autoFixed": {
            "type": "boolean"
          },
          "failed": {
            "type": "integer"
          },
          "failures": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "fixAttempts": {
            "type": "integer"
          },
          "log": {
            "type": "string"
          },
          "passed": {
            "type": "integer"
          },
          "runAt": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TopError": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "lastOccurred": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TriggerDefinition": {
        "properties": {
          "connector": {
            "$ref": "#/components/schemas/ConnectorRequirement"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "documentationUrl": {
            "type": "string"
          },
          "logoUrl": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "payloadSchema": {
            "$ref": "#/components/schemas/OrderedSchema"
          },
          "platform": {
            "description": "Platform grouping for integrations page (e.g., \"hyperliquid\")",
            "type": "string"
          },
          "resultSchema": {
            "$ref": "#/components/schemas/OrderedSchema"
          },
          "tags": {
            "description": "Tags for filtering and categorization",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "type": {
            "type": "string"
          },
          "waitPayloadSchema": {
            "$ref": "#/components/schemas/OrderedSchema"
          }
        },
        "type": "object"
      },
      "UsageTimeSeriesPoint": {
        "properties": {
          "bucketStart": {
            "description": "Start of time bucket (hourly or daily)",
            "type": "string"
          },
          "usageCount": {
            "description": "Number of executions in this bucket",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "VariableDef": {
        "properties": {
          "default": {},
          "description": {
            "type": "string"
          },
          "lifetime": {
            "$ref": "#/components/schemas/VariableLifetime"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/VariableType"
          }
        },
        "type": "object"
      },
      "VariableLifetime": {
        "enum": ["persist", "reset"],
        "type": "string",
        "x-enum-varnames": ["VariableLifetimePersist", "VariableLifetimeReset"]
      },
      "VariableOp": {
        "enum": ["set", "manual_set", "manual_reset"],
        "type": "string",
        "x-enum-varnames": [
          "VariableOpSet",
          "VariableOpManualSet",
          "VariableOpManualReset"
        ]
      },
      "VariableScope": {
        "enum": ["workflow", "run"],
        "type": "string",
        "x-enum-varnames": ["VariableScopeWorkflow", "VariableScopeRun"]
      },
      "VariableType": {
        "enum": ["number", "text", "boolean", "list", "object"],
        "type": "string",
        "x-enum-varnames": [
          "VariableTypeNumber",
          "VariableTypeText",
          "VariableTypeBoolean",
          "VariableTypeList",
          "VariableTypeObject"
        ]
      },
      "VariableValueWithMeta": {
        "properties": {
          "def": {
            "$ref": "#/components/schemas/VariableDef"
          },
          "hasValue": {
            "type": "boolean"
          },
          "lastRunId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "value": {},
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "VariableWrite": {
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "newValue": {},
          "oldValue": {},
          "op": {
            "$ref": "#/components/schemas/VariableOp"
          },
          "runId": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/VariableScope"
          },
          "workflowId": {
            "type": "string"
          },
          "writtenAt": {
            "type": "string"
          },
          "writtenByNode": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "VerificationStatus": {
        "description": "Verification status",
        "enum": ["pending", "verified", "failed"],
        "type": "string",
        "x-enum-varnames": [
          "VerificationStatusPending",
          "VerificationStatusVerified",
          "VerificationStatusFailed"
        ]
      },
      "WebhookEvent": {
        "properties": {
          "actionTaken": {
            "$ref": "#/components/schemas/WebhookEventAction"
          },
          "body": {
            "additionalProperties": {},
            "type": "object"
          },
          "createdAt": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Platform-specific: channelId, threadId, targetUrl, etc.",
            "type": "object"
          },
          "organizationId": {
            "type": "string"
          },
          "platform": {
            "description": "slack, telegram, discord, webhook",
            "type": "string"
          },
          "processedAt": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookEventStatus"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookEventAction": {
        "enum": ["triggered", "resumed", "skipped"],
        "type": "string",
        "x-enum-varnames": [
          "WebhookEventActionTriggered",
          "WebhookEventActionResumed",
          "WebhookEventActionSkipped"
        ]
      },
      "WebhookEventStatus": {
        "enum": ["pending", "success", "failure"],
        "type": "string",
        "x-enum-varnames": [
          "WebhookEventStatusPending",
          "WebhookEventStatusSuccess",
          "WebhookEventStatusFailure"
        ]
      },
      "Workflow": {
        "properties": {
          "aiDescription": {
            "type": "string"
          },
          "aiName": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "cooldownMs": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "descManuallySet": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "fundAutoSwapConfig": {
            "$ref": "#/components/schemas/WorkflowFundAutoSwapConfig"
          },
          "hasDraft": {
            "description": "Response-only fields (not persisted to database)\nHasDraft indicates a draft exists (for live workflows in API responses)",
            "type": "boolean"
          },
          "hasLiveVersion": {
            "description": "HasLiveVersion indicates a live version exists (for drafts in API responses)",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "lastTriggeredAt": {
            "type": "string"
          },
          "liveVersionPaused": {
            "description": "LiveVersionPaused indicates the live (active/paused) sibling row is paused.\nOnly meaningful when Status == draft && HasLiveVersion — the draft row is the\ncanonical DISPLAY row, so without this a caller can't tell the published sibling\nis paused without a second round trip (GET /v1/workflows/{id}/live).",
            "type": "boolean"
          },
          "maxRuns": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "nameManuallySet": {
            "type": "boolean"
          },
          "organizationId": {
            "type": "string"
          },
          "ownerUserId": {
            "type": "string"
          },
          "pausedReason": {
            "$ref": "#/components/schemas/PausedReason"
          },
          "publicRunCooldownSeconds": {
            "type": "integer"
          },
          "publicRunDailyLimit": {
            "type": "integer"
          },
          "publicWidgetConfig": {
            "$ref": "#/components/schemas/PublicWidgetConfig"
          },
          "remainRuns": {
            "type": "integer"
          },
          "sourceTemplateId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "triggerSecret": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/WorkflowType"
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          },
          "updatedAt": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "variableDefs": {
            "items": {
              "$ref": "#/components/schemas/VariableDef"
            },
            "type": "array",
            "uniqueItems": false
          },
          "version": {
            "type": "integer"
          },
          "versionCreatedBy": {
            "description": "VersionCreatedBy is the user who authored THIS version row. Unlike\nCreatedBy (asset creator, copied to every version for ownership) and\nUpdatedBy (overwritten by lifecycle ops like archiving), it is stamped\nonce at version insert and never mutated.",
            "type": "string"
          },
          "visibility": {
            "$ref": "#/components/schemas/WorkflowVisibility"
          },
          "x402Config": {
            "$ref": "#/components/schemas/X402Config"
          }
        },
        "type": "object"
      },
      "WorkflowDefinition": {
        "description": "Definition is the inline workflow graph to analyze. Same shape as a\nsaved workflow's definition. Unlike the ephemeral-run endpoint there\nis no trigger restriction — analysis is read-only and method-agnostic.",
        "properties": {
          "blockExpansions": {
            "additionalProperties": {
              "$ref": "#/components/schemas/BlockExpansionMeta"
            },
            "description": "Set on run snapshots only (not workflow DB)",
            "type": "object"
          },
          "inputSchema": {
            "items": {
              "$ref": "#/components/schemas/WorkflowInput"
            },
            "type": "array",
            "uniqueItems": false
          },
          "nodes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WorkflowNode"
            },
            "type": "object"
          },
          "sensitivePropKeys": {
            "description": "Legacy: kept for old runs; no longer populated for new workflows",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "triggerNodeIds": {
            "description": "TriggerNodeIDs lists the node IDs that are trigger (root) nodes. Every\nworkflow declares this — single-trigger workflows ship [\"root\"] (the\nlegacy node id), multi-trigger workflows list every trigger node id.\nTreating single-trigger as a forest-of-1 removes the two-path branching\nthroughout the BE + FE; older rows without the field are backfilled by\nmigration 000282 and the field-missing path stays as a read-side safety\nnet (see FindTriggerNodeIDs) but is no longer exercised by saves.\n\n\"root\" is also a runtime alias for \"the trigger that fired this run\" —\n{{root.X}} variable references resolve to the firing trigger regardless\nof which trigger fired. Don't repurpose the literal \"root\" as a trigger\nid on a multi-trigger workflow.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "variableDefs": {
            "description": "VariableDefs is a snapshot of the workflow's declared variables at run\ncreation time. The canonical source lives on the workflows row\n(Workflow.VariableDefs column). Snapshotted into the run definition\nso the worker can resolve {{$vars.x}} lookups and route variable-action\nwrites to the right scope without an extra DB round trip.",
            "items": {
              "$ref": "#/components/schemas/VariableDef"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["nodes"],
        "type": "object"
      },
      "WorkflowFundAutoSwapConfig": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "maxSwapAmountUsd": {
            "type": "number"
          },
          "mode": {
            "type": "string"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/OrgAutoSwapSource"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "WorkflowInput": {
        "properties": {
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "type": {
            "description": "\"string\", \"number\", \"boolean\", \"object\", \"array\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowNode": {
        "properties": {
          "blockContext": {
            "$ref": "#/components/schemas/BlockNodeContext"
          },
          "branch": {
            "description": "\"then\"/\"else\" (if parent), \"resumed\"/\"timed_out\" (wait parent)",
            "type": "string"
          },
          "children": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "connector": {
            "$ref": "#/components/schemas/ConnectorReference"
          },
          "description": {
            "description": "AI-generated 1-sentence description",
            "type": "string"
          },
          "loopBody": {
            "description": "Loop body nodes (only for for-each nodes)",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "payload": {
            "additionalProperties": {},
            "type": "object"
          },
          "resultSchema": {
            "additionalProperties": {},
            "description": "ResultSchema describes the output structure of this node (populated dynamically for x402 endpoints).\nThis is used by the frontend to show available output variables in the variable picker.",
            "type": "object"
          },
          "titleOverride": {
            "description": "AI-generated short title (2-6 words), only when more descriptive than default",
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": ["payload", "type"],
        "type": "object"
      },
      "WorkflowStatus": {
        "enum": ["draft", "active", "paused", "archived"],
        "type": "string",
        "x-enum-varnames": [
          "WorkflowStatusDraft",
          "WorkflowStatusActive",
          "WorkflowStatusPaused",
          "WorkflowStatusArchived"
        ]
      },
      "WorkflowType": {
        "enum": [
          "token-price-cexes",
          "evm-log",
          "cronjob",
          "schedule",
          "manual",
          "approval",
          "telegram-channel",
          "polymarket-user-bet",
          "polymarket-market-trade",
          "polymarket-new-market",
          "polymarket-market-close",
          "slack-mentions",
          "erc20-receive",
          "erc20-send",
          "anyspend",
          "shopify-order-created",
          "shopify-order-paid",
          "shopify-inventory-level-updated",
          "ramp-new-transaction",
          "ramp-transaction-status-updated",
          "ramp-transfer-payment-updated",
          "slack-new-reaction-added",
          "slack-new-message-in-channels",
          "slack-new-channel-created",
          "slack-new-direct-message",
          "slack-new-keyword-mention",
          "slack-new-user-added",
          "slack-new-user-mention",
          "slack-new-interaction-event",
          "telegram-new-interaction-event",
          "email-new-email-received",
          "email-new-email-matching-criteria",
          "gmail-new-email-received",
          "gmail-new-email-matching-search",
          "stripe-payment-receive",
          "eth-receive",
          "eth-send",
          "farcaster-new-cast",
          "farcaster-new-follower",
          "farcaster-new-reaction",
          "x-new-tweet",
          "exchange-listing",
          "coinbase-payment-received",
          "coinbase-checkout-received",
          "solana-transaction",
          "hyperliquid-price-alert",
          "hyperliquid-trade",
          "hyperliquid-user-fill",
          "hyperliquid-liquidation",
          "hyperliquid-position-change",
          "hyperliquid-transfer",
          "unusual-whales-options-flow-alerts",
          "unusual-whales-market-news",
          "kalshi-market-trade",
          "kalshi-new-market",
          "kalshi-market-close",
          "situation-fired"
        ],
        "type": "string",
        "x-enum-varnames": [
          "WorkflowTypeTokenPriceCexes",
          "WorkflowTypeEVMLog",
          "WorkflowTypeCronjob",
          "WorkflowTypeSchedule",
          "WorkflowTypeManual",
          "WorkflowTypeApproval",
          "WorkflowTypeTelegramChannel",
          "WorkflowTypePolymarketUserBet",
          "WorkflowTypePolymarketMarketTrade",
          "WorkflowTypePolymarketNewMarket",
          "WorkflowTypePolymarketMarketClose",
          "WorkflowTypeSlackMentions",
          "WorkflowTypeERC20Receive",
          "WorkflowTypeERC20Send",
          "WorkflowTypeAnyspend",
          "WorkflowTypeShopifyOrderCreated",
          "WorkflowTypeShopifyOrderPaid",
          "WorkflowTypeShopifyInventoryUpdated",
          "WorkflowTypeRampNewTransaction",
          "WorkflowTypeRampTransactionStatusUpdated",
          "WorkflowTypeRampTransferPaymentUpdated",
          "WorkflowTypeSlackNewReactionAdded",
          "WorkflowTypeSlackNewMessageInChannels",
          "WorkflowTypeSlackNewChannelCreated",
          "WorkflowTypeSlackNewDirectMessage",
          "WorkflowTypeSlackNewKeywordMention",
          "WorkflowTypeSlackNewUserAdded",
          "WorkflowTypeSlackNewUserMention",
          "WorkflowTypeSlackNewInteractionEvent",
          "WorkflowTypeTelegramNewInteractionEvent",
          "WorkflowTypeEmailNewEmailReceived",
          "WorkflowTypeEmailNewEmailMatchingCriteria",
          "WorkflowTypeGmailNewEmailReceived",
          "WorkflowTypeGmailNewEmailMatchSearch",
          "WorkflowTypeStripePaymentReceive",
          "WorkflowTypeETHReceive",
          "WorkflowTypeETHSend",
          "WorkflowTypeFarcasterNewCast",
          "WorkflowTypeFarcasterNewFollower",
          "WorkflowTypeFarcasterNewReaction",
          "WorkflowTypeXNewTweet",
          "WorkflowTypeExchangeListing",
          "WorkflowTypeCoinbasePaymentReceived",
          "WorkflowTypeCoinbaseCheckoutReceived",
          "WorkflowTypeSolanaTransaction",
          "WorkflowTypeHyperliquidPriceAlert",
          "WorkflowTypeHyperliquidTrade",
          "WorkflowTypeHyperliquidUserFill",
          "WorkflowTypeHyperliquidLiquidation",
          "WorkflowTypeHyperliquidPositionChange",
          "WorkflowTypeHyperliquidTransfer",
          "WorkflowTypeOptionsFlowAlerts",
          "WorkflowTypeMarketNews",
          "WorkflowTypeKalshiMarketTrade",
          "WorkflowTypeKalshiNewMarket",
          "WorkflowTypeKalshiMarketClose",
          "WorkflowTypeSituationFired"
        ]
      },
      "WorkflowUIMetadata": {
        "properties": {
          "comments": {
            "items": {
              "$ref": "#/components/schemas/Comment"
            },
            "type": "array",
            "uniqueItems": false
          },
          "nodePositions": {
            "additionalProperties": {
              "$ref": "#/components/schemas/NodePosition"
            },
            "type": "object"
          },
          "stickyNotes": {
            "items": {
              "$ref": "#/components/schemas/StickyNote"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "WorkflowVisibility": {
        "enum": ["private", "org", "public_view", "public_execute"],
        "type": "string",
        "x-enum-varnames": [
          "WorkflowVisibilityPrivate",
          "WorkflowVisibilityOrg",
          "WorkflowVisibilityPublicView",
          "WorkflowVisibilityPublicExecute"
        ]
      },
      "X402Config": {
        "properties": {
          "chainId": {
            "description": "Chain ID where payment should be made (e.g., 8453 for Base)",
            "type": "integer"
          },
          "discoverable": {
            "description": "Discoverable controls whether this workflow is listed in the Bazaar public catalog.\nBazaar is a discovery marketplace where users can find and pay for x402-enabled endpoints.\nWhen true:  Endpoint is publicly listed, anyone can trigger with payment only (no secret needed).\nWhen false: Endpoint is private, requires both secret and payment to trigger.",
            "type": "boolean"
          },
          "discoveryInput": {
            "$ref": "#/components/schemas/X402DiscoverySchema"
          },
          "discoveryMetadata": {
            "$ref": "#/components/schemas/X402DiscoveryMetadata"
          },
          "discoveryOutput": {
            "$ref": "#/components/schemas/X402DiscoverySchema"
          },
          "price": {
            "description": "Price in the smallest unit of the token (e.g., wei for ETH, 6 decimals for USDC)",
            "type": "string"
          },
          "recipient": {
            "description": "Recipient address that will receive the payment",
            "type": "string"
          },
          "token": {
            "description": "Token address (e.g., USDC contract address)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "X402DiscoveryMetadata": {
        "properties": {
          "category": {
            "description": "Category groups workflows (e.g., \"data\", \"automation\", \"ai\")",
            "type": "string"
          },
          "description": {
            "description": "Description provides details about what the workflow does",
            "type": "string"
          },
          "documentation": {
            "description": "Documentation URL for additional documentation",
            "type": "string"
          },
          "logo": {
            "description": "Logo URL for the workflow/provider logo",
            "type": "string"
          },
          "name": {
            "description": "Name is the display name for the workflow",
            "type": "string"
          },
          "provider": {
            "description": "Provider is the name of the entity providing this workflow",
            "type": "string"
          },
          "tags": {
            "description": "Tags for searchable keywords",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "X402DiscoverySchema": {
        "properties": {
          "example": {
            "description": "Example provides a sample value for documentation and testing"
          },
          "schema": {
            "additionalProperties": {},
            "description": "Schema is a JSON Schema definition for validation",
            "type": "object"
          }
        },
        "type": "object"
      },
      "X402Endpoint": {
        "properties": {
          "avgResponseMs": {
            "type": "integer"
          },
          "baseUrl": {
            "description": "=== ENDPOINT IDENTITY ===\nBaseURL is the clean URL without query params (e.g., \"https://api.example.com/search\")",
            "type": "string"
          },
          "bodyParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "category": {
            "type": "string"
          },
          "createdAt": {
            "description": "=== TIMESTAMPS ===",
            "type": "string"
          },
          "defaultBody": {
            "additionalProperties": {},
            "type": "object"
          },
          "defaultHeaders": {
            "additionalProperties": {},
            "type": "object"
          },
          "defaultQueryParams": {
            "additionalProperties": {},
            "description": "Default values (applied if user doesn't provide at runtime)",
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "exampleBody": {},
          "exampleOutput": {},
          "exampleQueryParams": {
            "additionalProperties": {},
            "description": "=== EXAMPLES ===",
            "type": "object"
          },
          "failureCount": {
            "type": "integer"
          },
          "headerParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "inputSummary": {
            "type": "string"
          },
          "lastCalledAt": {
            "type": "string"
          },
          "lastError": {
            "type": "string"
          },
          "lastErrorAt": {
            "type": "string"
          },
          "maxAllowedPrice": {
            "description": "Price protection (auto 5x of import price)",
            "type": "string"
          },
          "method": {
            "description": "GET, POST, PUT, DELETE",
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "name": {
            "description": "=== METADATA ===",
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "outputSchema": {
            "additionalProperties": {},
            "description": "=== OUTPUT ===",
            "type": "object"
          },
          "outputSummary": {
            "type": "string"
          },
          "payTo": {
            "type": "string"
          },
          "price": {
            "description": "=== PAYMENT INFO ===",
            "type": "string"
          },
          "queryParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "description": "=== INPUT CONFIGURATION ===\nCDP-aligned flat structure: {\"paramName\": {\"type\": \"string\", \"description\": \"...\", \"required\": true}}",
            "type": "object"
          },
          "source": {
            "$ref": "#/components/schemas/X402EndpointSource"
          },
          "spentByToken": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Multi-token spending tracker: {\"0x833...\": \"50000\", \"0xb3b...\": \"1000000000000000000\"}",
            "type": "object"
          },
          "successCount": {
            "description": "=== STATS ===",
            "type": "integer"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "tokenAddress": {
            "type": "string"
          },
          "tokenDecimals": {
            "type": "integer"
          },
          "tokenSymbol": {
            "type": "string"
          },
          "totalCalls": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "string"
          },
          "useCases": {
            "description": "=== AI FIELDS ===",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "X402EndpointProbeResult": {
        "properties": {
          "accepts": {
            "description": "Full accepts array for reference",
            "items": {
              "$ref": "#/components/schemas/X402PaymentOption"
            },
            "type": "array",
            "uniqueItems": false
          },
          "baseUrl": {
            "description": "=== PARSED FROM URL ===",
            "type": "string"
          },
          "bodyParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "detectedParams": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Query params found in URL",
            "type": "object"
          },
          "error": {
            "description": "Error message if probe failed",
            "type": "string"
          },
          "headerParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "method": {
            "description": "=== OPTIONAL (from 402 response) ===",
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "outputSchema": {
            "additionalProperties": {},
            "type": "object"
          },
          "payTo": {
            "type": "string"
          },
          "price": {
            "description": "=== ALWAYS AVAILABLE (core protocol) ===",
            "type": "string"
          },
          "queryParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "description": "=== EXTRACTED FROM outputSchema (normalized) ===",
            "type": "object"
          },
          "success": {
            "description": "Whether the probe succeeded",
            "type": "boolean"
          },
          "tokenAddress": {
            "type": "string"
          },
          "tokenDecimals": {
            "type": "integer"
          },
          "tokenName": {
            "type": "string"
          },
          "tokenSymbol": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "X402EndpointSource": {
        "enum": ["user_import", "cdp_bazaar"],
        "type": "string",
        "x-enum-comments": {
          "X402EndpointSourceCDPBazaar": "Imported from CDP Bazaar discovery API",
          "X402EndpointSourceUserImport": "Manually imported by user"
        },
        "x-enum-varnames": [
          "X402EndpointSourceUserImport",
          "X402EndpointSourceCDPBazaar"
        ]
      },
      "X402OutputSchema": {
        "description": "OutputSchema for discovery registration (matches TypeScript SDK format)",
        "properties": {
          "discoveryOutput": {
            "$ref": "#/components/schemas/X402DiscoverySchema"
          },
          "input": {
            "$ref": "#/components/schemas/X402OutputSchemaInput"
          },
          "metadata": {
            "$ref": "#/components/schemas/X402DiscoveryMetadata"
          },
          "output": {}
        },
        "type": "object"
      },
      "X402OutputSchemaInput": {
        "properties": {
          "body": {
            "additionalProperties": {},
            "description": "Body contains JSON Schema for body parameters (used by some x402 providers)",
            "type": "object"
          },
          "bodyFields": {
            "additionalProperties": {},
            "description": "BodyFields contains body field definitions in alternative CDP format",
            "type": "object"
          },
          "bodyParams": {
            "additionalProperties": {},
            "description": "BodyParams contains body param definitions in CDP format",
            "type": "object"
          },
          "discoverable": {
            "type": "boolean"
          },
          "discoveryInput": {
            "$ref": "#/components/schemas/X402DiscoverySchema"
          },
          "method": {
            "type": "string"
          },
          "query": {
            "additionalProperties": {},
            "description": "Query contains JSON Schema for query parameters (used by some x402 providers)",
            "type": "object"
          },
          "queryParams": {
            "additionalProperties": {},
            "description": "QueryParams contains query param definitions in CDP format",
            "type": "object"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "X402PaymentExtra": {
        "properties": {
          "chainId": {
            "description": "ChainID is the chain ID for EIP-712 domain (from quote)",
            "type": "integer"
          },
          "facilitatorAddress": {
            "description": "FacilitatorAddress is the facilitator's address that will be approved as spender",
            "type": "string"
          },
          "name": {
            "description": "Name is the ERC20 token name (used in EIP-712 domain)",
            "type": "string"
          },
          "signatureType": {
            "description": "SignatureType specifies the signature method: \"authorization\" (EIP-3009) or \"permit\" (ERC-2612)",
            "type": "string"
          },
          "verifyingContract": {
            "description": "VerifyingContract is the token contract address for EIP-712 domain (from quote)",
            "type": "string"
          },
          "version": {
            "description": "Version is the ERC20 token version (used in EIP-712 domain)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "X402PaymentOption": {
        "properties": {
          "amount": {
            "description": "Amount is the v2 equivalent of MaxAmountRequired.\nDuring normalization, Amount is copied to MaxAmountRequired\nif MaxAmountRequired is empty.",
            "type": "string"
          },
          "asset": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "extra": {
            "$ref": "#/components/schemas/X402PaymentExtra"
          },
          "maxAmountRequired": {
            "type": "string"
          },
          "maxTimeoutSeconds": {
            "type": "integer"
          },
          "mimeType": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "outputSchema": {
            "$ref": "#/components/schemas/X402OutputSchema"
          },
          "payTo": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "scheme": {
            "type": "string"
          },
          "srcAmountRequired": {
            "type": "string"
          },
          "srcNetwork": {
            "type": "string"
          },
          "srcTokenAddress": {
            "description": "Cross-token payment fields (set when buyer uses X-PREFERRED-TOKEN)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReceivedLegDisplay": {
        "description": "ReceivedDisplay is DISPLAY-ONLY context describing what the SAME node\nreceives, attached only when this sent leg has no RequiredAmount of its\nown. See the ReceivedLegDisplay doc for the boundary it must not cross.",
        "properties": {
          "amount": {
            "description": "Amount is the received leg's resolved amount: a literal from the\npayload, or the exact constant-fold of an upstream literal-only\nconvert-to-wei node. Never estimated.",
            "type": "string"
          },
          "amountUnit": {
            "description": "AmountUnit declares the unit of the amount when the analyzer KNOWS it,\nrather than inferring it from the string's shape.\n\n\t\"raw\" — smallest units (wei-like). ONLY the constant-fold sets this: it\n\t        computes the integer itself, so it is the one producer that knows.\n\t\"\"    — unknown. Consumers MUST print the value verbatim and MUST NOT\n\t        rescale it by decimals.\n\nDeliberately has no \"human\" value yet. Action payloads don't carry unit\nmetadata, so claiming \"human\" would be the same guess in a new coat.",
            "type": "string"
          },
          "chainId": {
            "type": "integer"
          },
          "chainName": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "isHumanReadable": {
            "description": "IsHumanReadable mirrors Requirement.AmountIsHumanReadable for Amount:\ntrue for values like \"0.5\", false for raw smallest-unit integers.",
            "type": "boolean"
          },
          "symbol": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Requirement": {
        "properties": {
          "amountIsHumanReadable": {
            "type": "boolean"
          },
          "amountIsPartial": {
            "description": "AmountIsPartial means RequiredAmount understates the true total for a reason\nOTHER than a runtime expression: an operand was dropped, or the amount is\nper-iteration inside a loop. Floor semantics apply (the number is a lower\nbound) but NO claim about a later step computing the remainder is true.",
            "type": "boolean"
          },
          "amountRuntimeDetermined": {
            "description": "AmountRuntimeDetermined is true when the leg's amount is wired to a runtime\nexpression ({{...}}) rather than a literal, and could not be constant-folded.\nThe leg's IDENTITY (chain + token) is fully resolved — only the SIZE is unknown\nuntil the workflow runs. Distinct from Unresolved, which means the identity\nitself could not be determined.\n\nWhen multiple legs sharing the same dedup key (wallet + chain + token)\nare merged (addOrMerge), this flag is true if ANY contributing leg was\nruntime-determined — even when another contributing leg supplied a\nliteral amount. It is never cleared just because a literal amount is\nalso present.\n\nFLOOR SEMANTICS: when this is true AND RequiredAmount is non-empty, the\ntwo fields are BOTH meaningful together: RequiredAmount is the sum of\nonly the literal contributing legs — a known LOWER BOUND on the true\nrequirement, not the total (the runtime-determined leg's own\ncontribution is never invented). Treat RequiredAmount as \"at least X\"\nin this state. isInsufficient MAY still be computed against this floor\nand MAY be true — a balance below the floor is a genuine shortfall. A\nbalance at or above the floor is UNKNOWN sufficiency, not proven\nsufficient.",
            "type": "boolean"
          },
          "amountUnit": {
            "description": "AmountUnit declares the unit of the amount when the analyzer KNOWS it,\nrather than inferring it from the string's shape.\n\n\t\"raw\" — smallest units (wei-like). ONLY the constant-fold sets this: it\n\t        computes the integer itself, so it is the one producer that knows.\n\t\"\"    — unknown. Consumers MUST print the value verbatim and MUST NOT\n\t        rescale it by decimals.\n\nDeliberately has no \"human\" value yet. Action payloads don't carry unit\nmetadata, so claiming \"human\" would be the same guess in a new coat.",
            "type": "string"
          },
          "chainId": {
            "type": "integer"
          },
          "chainName": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "isNative": {
            "type": "boolean"
          },
          "nodeId": {
            "type": "string"
          },
          "nodeName": {
            "type": "string"
          },
          "nodeType": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "receivedDisplay": {
            "$ref": "#/components/schemas/ReceivedLegDisplay"
          },
          "requiredAmount": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/RequirementSource"
          },
          "symbol": {
            "type": "string"
          },
          "tokenAddress": {
            "type": "string"
          },
          "unresolved": {
            "type": "boolean"
          },
          "unresolvedReason": {
            "$ref": "#/components/schemas/UnresolvedReason"
          },
          "walletAddress": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RequirementSource": {
        "enum": [
          "requiredTokens",
          "fundsMovement.sent",
          "fundsMovement.received",
          "requiresGas"
        ],
        "type": "string",
        "x-enum-varnames": [
          "SourceRequiredTokens",
          "SourceFundsMovementSent",
          "SourceFundsMovementReceived",
          "SourceRequiresGas"
        ]
      },
      "UnresolvedReason": {
        "enum": ["chainId", "tokenAddress", "parseError", "template"],
        "type": "string",
        "x-enum-varnames": [
          "UnresolvedChainID",
          "UnresolvedTokenAddress",
          "UnresolvedParseError",
          "UnresolvedTemplate"
        ]
      },
      "PaginatedData-Template": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Template"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-WebhookEvent": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "internal_app_api_http_v1_blockcursor.BlockCursorResponse": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "lastBlock": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_app_api_http_v1_contract.SaveProjectRequest": {
        "properties": {
          "name": {
            "maxLength": 100,
            "type": "string"
          },
          "planSummary": {
            "$ref": "#/components/schemas/ContractPlanSummary"
          },
          "sessionId": {
            "description": "For new projects",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/ContractSource"
          },
          "testResults": {
            "$ref": "#/components/schemas/TestResults"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "internal_app_api_http_v1_run.resumeBody": {
        "properties": {
          "data": {
            "additionalProperties": {},
            "type": "object"
          },
          "forEachContext": {
            "$ref": "#/components/schemas/ForEachContext"
          }
        },
        "type": "object"
      },
      "internal_app_api_http_v1_userinterests.addInterestRequest": {
        "properties": {
          "value": {
            "type": "string"
          }
        },
        "required": ["value"],
        "type": "object"
      },
      "internal_app_api_http_v1_workflow.WorkflowScheduleResponse": {
        "properties": {
          "nextRunAt": {
            "type": "string"
          },
          "serverTime": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ActionProxyData": {
        "properties": {
          "result": {
            "additionalProperties": {},
            "type": "object"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ActionProxyParams": {
        "properties": {
          "connectorId": {
            "type": "string"
          },
          "connectorType": {
            "type": "string"
          },
          "payload": {
            "additionalProperties": {},
            "type": "object"
          },
          "simulate": {
            "type": "boolean"
          },
          "walletId": {
            "type": "string"
          }
        },
        "required": ["payload"],
        "type": "object"
      },
      "ActionProxyQueryParams": {
        "properties": {
          "connectorId": {
            "type": "string"
          },
          "connectorType": {
            "type": "string"
          },
          "payload": {
            "additionalProperties": {},
            "type": "object"
          },
          "simulate": {
            "type": "boolean"
          },
          "walletId": {
            "type": "string"
          }
        },
        "required": ["payload"],
        "type": "object"
      },
      "ActionProxySuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ActionProxyData"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ActionTestError": {
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AgentArtifactItem": {
        "properties": {
          "agentType": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AgentRunData": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/RunEvent"
            },
            "type": "array",
            "uniqueItems": false
          },
          "state": {
            "$ref": "#/components/schemas/RunState"
          }
        },
        "type": "object"
      },
      "AgentRunHistoryItem": {
        "properties": {
          "agentType": {
            "type": "string"
          },
          "completionTokens": {
            "type": "integer"
          },
          "costUsd": {
            "type": "number"
          },
          "createdAt": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "finishedAt": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "promptTokens": {
            "type": "integer"
          },
          "runId": {
            "type": "string"
          },
          "servedUrl": {
            "description": "ServedURL is the absolute, browser-openable address of the served report,\nempty when the run served no artifact (or the worker base is unconfigured).",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "turns": {
            "type": "integer"
          },
          "usageModel": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AgentTypeInfo": {
        "properties": {
          "agentType": {
            "description": "AgentType is the registry key passed back as StartAgentRunParams.AgentType.",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "serves": {
            "description": "Serves is true when the agent produces a browser-openable artifact\n(a report or app) at the run's served URL.",
            "type": "boolean"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AnalyzeFundsBalance": {
        "properties": {
          "amount": {
            "description": "raw units (wei)",
            "type": "string"
          },
          "amountIsPartial": {
            "description": "AmountIsPartial mirrors funds.Requirement.AmountIsPartial: true when\nRequiredAmount understates the true total for a reason OTHER than a\nruntime expression — a dropped operand on a unit mismatch, or a\nper-iteration amount inside a loop. Same FLOOR semantics as\nAmountRuntimeDetermined (the amount is a known lower bound, and\nIsInsufficient=true against it is a genuine shortfall), but unlike that\nflag there is no runtime expression that a later step resolves — no\nclaim is made about anything computing the remainder.",
            "type": "boolean"
          },
          "amountRuntimeDetermined": {
            "description": "AmountRuntimeDetermined mirrors funds.Requirement.AmountRuntimeDetermined:\ntrue when at least one contributing leg's amount is wired to a runtime\nexpression and could not be resolved statically.\n\nWhen this is true and the requirement has no known amount at all,\nIsInsufficient stays false (nothing to compare against — \"unknown\", not\n\"known and sufficient\").\n\nWhen this is true AND a RequiredAmount IS present (merged with a\nliteral-amount leg), that amount is only a known FLOOR — the literal\nlegs' sum, not the true total — and IsInsufficient IS computed against\nit. IsInsufficient=true there is a genuine shortfall. But\nIsInsufficient=false is still NOT proof of sufficiency: it only means\nthe balance clears the known floor, not the (partially unknown) total.\nConsumers must key off AmountRuntimeDetermined AND AmountIsPartial, not\nIsInsufficient alone, to know whether \"sufficient\" can be asserted —\nboth flags carry the identical FLOOR semantics described above.",
            "type": "boolean"
          },
          "amountUsd": {
            "type": "number"
          },
          "chainId": {
            "type": "integer"
          },
          "decimals": {
            "type": "integer"
          },
          "isInsufficient": {
            "description": "amount < requiredAmount",
            "type": "boolean"
          },
          "isLow": {
            "description": "gas only: balance below LowGasThreshold",
            "type": "boolean"
          },
          "symbol": {
            "type": "string"
          },
          "tokenAddress": {
            "type": "string"
          },
          "walletAddress": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AnalyzeFundsDefinitionParams": {
        "properties": {
          "defaultWalletAddress": {
            "description": "DefaultWalletAddress overrides the wallet used when a node has no\nexplicit connector or payload wallet field. When empty, the org's\ndefault wallet is used (same fallback as the saved-workflow path).",
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          }
        },
        "required": ["definition"],
        "type": "object"
      },
      "AnalyzeFundsRequirement": {
        "properties": {
          "amountIsHumanReadable": {
            "type": "boolean"
          },
          "amountIsPartial": {
            "description": "AmountIsPartial means RequiredAmount understates the true total for a reason\nOTHER than a runtime expression: an operand was dropped, or the amount is\nper-iteration inside a loop. Floor semantics apply (the number is a lower\nbound) but NO claim about a later step computing the remainder is true.",
            "type": "boolean"
          },
          "amountRuntimeDetermined": {
            "description": "AmountRuntimeDetermined is true when the leg's amount is wired to a runtime\nexpression ({{...}}) rather than a literal, and could not be constant-folded.\nThe leg's IDENTITY (chain + token) is fully resolved — only the SIZE is unknown\nuntil the workflow runs. Distinct from Unresolved, which means the identity\nitself could not be determined.\n\nWhen multiple legs sharing the same dedup key (wallet + chain + token)\nare merged (addOrMerge), this flag is true if ANY contributing leg was\nruntime-determined — even when another contributing leg supplied a\nliteral amount. It is never cleared just because a literal amount is\nalso present.\n\nFLOOR SEMANTICS: when this is true AND RequiredAmount is non-empty, the\ntwo fields are BOTH meaningful together: RequiredAmount is the sum of\nonly the literal contributing legs — a known LOWER BOUND on the true\nrequirement, not the total (the runtime-determined leg's own\ncontribution is never invented). Treat RequiredAmount as \"at least X\"\nin this state. isInsufficient MAY still be computed against this floor\nand MAY be true — a balance below the floor is a genuine shortfall. A\nbalance at or above the floor is UNKNOWN sufficiency, not proven\nsufficient.",
            "type": "boolean"
          },
          "amountUnit": {
            "description": "AmountUnit declares the unit of the amount when the analyzer KNOWS it,\nrather than inferring it from the string's shape.\n\n\t\"raw\" — smallest units (wei-like). ONLY the constant-fold sets this: it\n\t        computes the integer itself, so it is the one producer that knows.\n\t\"\"    — unknown. Consumers MUST print the value verbatim and MUST NOT\n\t        rescale it by decimals.\n\nDeliberately has no \"human\" value yet. Action payloads don't carry unit\nmetadata, so claiming \"human\" would be the same guess in a new coat.",
            "type": "string"
          },
          "balance": {
            "$ref": "#/components/schemas/AnalyzeFundsBalance"
          },
          "chainId": {
            "type": "integer"
          },
          "chainName": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "isNative": {
            "type": "boolean"
          },
          "nodeId": {
            "type": "string"
          },
          "nodeName": {
            "type": "string"
          },
          "nodeType": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "receivedDisplay": {
            "$ref": "#/components/schemas/ReceivedLegDisplay"
          },
          "requiredAmount": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/RequirementSource"
          },
          "symbol": {
            "type": "string"
          },
          "tokenAddress": {
            "type": "string"
          },
          "unresolved": {
            "type": "boolean"
          },
          "unresolvedReason": {
            "$ref": "#/components/schemas/UnresolvedReason"
          },
          "walletAddress": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AnalyzeFundsResponse": {
        "properties": {
          "balancesFetched": {
            "type": "boolean"
          },
          "requirements": {
            "items": {
              "$ref": "#/components/schemas/AnalyzeFundsRequirement"
            },
            "type": "array",
            "uniqueItems": false
          },
          "unresolved": {
            "items": {
              "$ref": "#/components/schemas/Requirement"
            },
            "type": "array",
            "uniqueItems": false
          },
          "workflowId": {
            "type": "string"
          },
          "workflowVersion": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AnalyzeFundsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/AnalyzeFundsResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AnySpendOrderCallbackParams": {
        "properties": {
          "callbackMetadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "clientReferenceId": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/AnySpendPaymentDetails"
          },
          "status": {
            "type": "string"
          },
          "txHash": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AnySpendOrderCallbackResponse": {
        "properties": {
          "executionId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AnySpendPaymentDetails": {
        "properties": {
          "dstAmount": {
            "type": "string"
          },
          "dstChain": {
            "type": "integer"
          },
          "dstTokenAddress": {
            "type": "string"
          },
          "dstTokenDecimals": {
            "type": "integer"
          },
          "dstTokenSymbol": {
            "type": "string"
          },
          "recipientAddress": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppGatewayMintTokenResponse": {
        "properties": {
          "exp": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppGatewayMintViewerTokenParams": {
        "properties": {
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppGatewayResumeData": {
        "properties": {
          "action": {
            "example": "resumed",
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppGatewayRunData": {
        "properties": {
          "appId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppGatewayRunDetailData": {
        "properties": {
          "inputs": {
            "additionalProperties": {},
            "type": "object"
          },
          "outputs": {
            "additionalProperties": {
              "additionalProperties": {},
              "type": "object"
            },
            "type": "object"
          },
          "runId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppGatewayRunsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-RunListItem"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ApproveContractDeployParams": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "constructorArgs": {
            "items": {},
            "type": "array",
            "uniqueItems": false
          },
          "deploymentMode": {
            "enum": ["standard", "create2", "create3"],
            "type": "string"
          },
          "salt": {
            "description": "Custom salt for deterministic deployment",
            "type": "string"
          },
          "target": {
            "enum": ["testnet", "mainnet"],
            "type": "string"
          },
          "walletId": {
            "type": "string"
          }
        },
        "required": ["chainId", "target", "walletId"],
        "type": "object"
      },
      "ApproveContractDeploySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ContractDeployApproval"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ApproveContractPlanParams": {
        "properties": {
          "approved": {
            "type": "boolean"
          }
        },
        "required": ["approved"],
        "type": "object"
      },
      "ApproveContractPlanSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ContractPlanApproval"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AutoSwapSourceParams": {
        "properties": {
          "chainId": {
            "description": "ChainID is the source chain to sell from.",
            "type": "integer"
          },
          "id": {
            "description": "ID is a stable identifier for this source. Leave empty to auto-generate on create.",
            "type": "string"
          },
          "priority": {
            "description": "Priority controls evaluation order (lower = tried first).",
            "type": "integer"
          },
          "slippageBps": {
            "description": "SlippageBps is the swap slippage tolerance in basis points (0-8000). Default 300 (3%).",
            "type": "integer"
          },
          "tokenAddress": {
            "description": "TokenAddress is the token to sell. Use \"native\" for native gas tokens or a 0x address.",
            "type": "string"
          },
          "tokenDecimals": {
            "description": "TokenDecimals is the number of decimal places for the token (e.g. 18 for ETH, 6 for USDC). UI only.",
            "type": "integer"
          },
          "walletId": {
            "description": "WalletID is the org wallet to sell tokens from.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AvailableAssetsTokenPriceCexesSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/StorkAvailableAssetsResponse"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BatchWorkflowMetaRequest": {
        "properties": {
          "workflowIds": {
            "items": {
              "type": "string"
            },
            "maxItems": 200,
            "minItems": 1,
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["workflowIds"],
        "type": "object"
      },
      "BatchWorkflowMetaResponse": {
        "additionalProperties": {
          "$ref": "#/components/schemas/WorkflowMetaItem"
        },
        "type": "object"
      },
      "BatchWorkflowMetaSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/BatchWorkflowMetaResponse"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "BatchWorkflowStatsRequest": {
        "properties": {
          "workflowIds": {
            "items": {
              "type": "string"
            },
            "maxItems": 200,
            "minItems": 1,
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["workflowIds"],
        "type": "object"
      },
      "BatchWorkflowStatsResponse": {
        "additionalProperties": {
          "$ref": "#/components/schemas/WorkflowStatsSummary"
        },
        "type": "object"
      },
      "BatchWorkflowStatsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/BatchWorkflowStatsResponse"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "BillingInvoiceResponse": {
        "properties": {
          "amountDue": {
            "type": "integer"
          },
          "amountPaid": {
            "type": "integer"
          },
          "amountRemaining": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "dueAt": {
            "type": "string"
          },
          "hostedInvoiceUrl": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoicePdf": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "BillingPaymentMethodResponse": {
        "properties": {
          "billingEmail": {
            "type": "string"
          },
          "billingName": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "expMonth": {
            "type": "integer"
          },
          "expYear": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "last4": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "BulkUpsertResultData": {
        "properties": {
          "totalReceived": {
            "type": "integer"
          },
          "upsertedCount": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "BulkUpsertSeoPagesParams": {
        "properties": {
          "pages": {
            "items": {
              "$ref": "#/components/schemas/SeoIntegrationPage"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["pages"],
        "type": "object"
      },
      "BulkUpsertSeoPagesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/BulkUpsertResultData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CaddieMemoryItem": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "scope": {
            "description": "\"profile\" (always-injected identity) | \"notes\" (searchable history)",
            "type": "string"
          },
          "source": {
            "description": "\"user\" | \"agent\" | \"reflection\" (absent on legacy rows)",
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CancelAgentRunData": {
        "properties": {
          "ok": {
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CancelAgentRunSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CancelAgentRunData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChatImageAttachment": {
        "properties": {
          "base64": {
            "type": "string"
          },
          "ipfsUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChatParams": {
        "properties": {
          "agentVersion": {
            "description": "Optional - agent version toggle; \"v3\" routes to the caddie service (open to every org)",
            "enum": ["v1", "v2", "v3", "both"],
            "type": "string"
          },
          "apiKeyOverride": {
            "description": "Optional - override the LLM API key for this request (eval/testing use only)",
            "maxLength": 300,
            "type": "string"
          },
          "conversationId": {
            "description": "Stable conversation identifier (generated client-side, persists across session→workflow transition)",
            "maxLength": 255,
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "description": "Optional - for generating new workflow",
            "maxLength": 500,
            "type": "string"
          },
          "enabledDeepAgents": {
            "description": "Optional - per-conversation allowlist of deep agents Caddie may delegate to. Pointer distinguishes absent (nil) from present ([]: none / [a,b]: only those). This is only ever NARROWING: the signed claim is the org's setting INTERSECTED with this (v1/ai.narrowDeepAgents), so sending an agent the org disabled does not enable it. The web chat currently omits it.",
            "items": {
              "type": "string"
            },
            "maxItems": 32,
            "type": "array",
            "uniqueItems": false
          },
          "images": {
            "description": "Optional - images attached to the message (base64 for LLM, IPFS for storage)",
            "items": {
              "$ref": "#/components/schemas/ChatImageAttachment"
            },
            "type": "array",
            "uniqueItems": false
          },
          "lastEventIndex": {
            "description": "Last received event index for replay (reconnection)",
            "minimum": 0,
            "type": "integer"
          },
          "message": {
            "description": "Optional on reconnect, required for new sessions",
            "maxLength": 10000,
            "type": "string"
          },
          "modelOverride": {
            "description": "Optional - override the LLM model for this request (eval/testing use only)",
            "maxLength": 200,
            "type": "string"
          },
          "name": {
            "description": "Optional - for generating new workflow",
            "maxLength": 100,
            "type": "string"
          },
          "preferredMode": {
            "description": "Optional - user's preferred mode hint; overrides auto-classifier when set",
            "enum": ["planning", "building", "repair", "conversation"],
            "type": "string"
          },
          "requestId": {
            "description": "Client-generated UUID4 for persistent session tracking (optional for legacy/inline mode)",
            "type": "string"
          },
          "sessionId": {
            "description": "Optional - metadata: which create-page session started this conversation",
            "type": "string"
          },
          "temperatureOverride": {
            "description": "Optional - override the LLM temperature for this request (eval/testing use only)",
            "maximum": 2,
            "minimum": 0,
            "type": "number"
          },
          "templateSearchMode": {
            "description": "Optional - template search mode toggle (defaults to lightweight)",
            "enum": ["lightweight", "hybrid"],
            "type": "string"
          },
          "timezone": {
            "description": "Optional - user's IANA timezone (e.g. \"America/New_York\") for time-aware responses",
            "type": "string"
          },
          "workflowId": {
            "description": "Optional - metadata: which workflow this conversation is about",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChatSession": {
        "properties": {
          "contextType": {
            "description": "ContextType indicates whether this is a \"session\" or \"workflow\" chat",
            "type": "string"
          },
          "conversationId": {
            "description": "ConversationID for V3 sessions (stable thread identifier)",
            "type": "string"
          },
          "firstMessageAt": {
            "description": "FirstMessageAt is when the first message was sent",
            "type": "string"
          },
          "lastMessageAt": {
            "description": "LastMessageAt is when the last message was sent",
            "type": "string"
          },
          "messageCount": {
            "description": "MessageCount is the total number of messages in this session",
            "type": "integer"
          },
          "preview": {
            "description": "Preview is the content of the first user message (truncated)",
            "type": "string"
          },
          "sessionId": {
            "description": "SessionID for create-page sessions (client-generated, e.g., session_1234567890_abc)",
            "type": "string"
          },
          "workflowId": {
            "description": "WorkflowID for edit-page sessions (server-generated UUID)",
            "type": "string"
          },
          "workflowName": {
            "description": "WorkflowName is the name of the associated workflow (if available)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CheckTelegramPinSuccessResponse": {
        "properties": {
          "chat": {
            "$ref": "#/components/schemas/TelegramVerifiedChat"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CheckVerificationStatusResponse": {
        "properties": {
          "deployments": {
            "items": {
              "$ref": "#/components/schemas/DeploymentVerificationStatus"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "CheckX402EndpointData": {
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/X402Endpoint"
          },
          "exists": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CheckX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CheckX402EndpointData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ClaimFaucetParams": {
        "properties": {
          "tokens": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "walletAddress": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ClaimFaucetResult": {
        "properties": {
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ClearCaddieMemoryResponse": {
        "properties": {
          "cleared": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ClearCaddieMemorySuccessResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ClearCaddieMemoryResponse"
          }
        },
        "type": "object"
      },
      "ColumnInfo": {
        "properties": {
          "defaultValue": {},
          "name": {
            "type": "string"
          },
          "notNull": {
            "type": "boolean"
          },
          "primaryKey": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContractChatAction": {
        "description": "Optional explicit action",
        "enum": ["approve_plan", "reject_plan"],
        "type": "string",
        "x-enum-varnames": [
          "ContractChatActionApprovePlan",
          "ContractChatActionRejectPlan"
        ]
      },
      "ContractChatParams": {
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ContractChatAction"
          },
          "contractId": {
            "description": "ContractID is the primary identifier (optional for first message - backend creates project)",
            "type": "string"
          },
          "message": {
            "maxLength": 51200,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContractDeployApproval": {
        "properties": {
          "estimate": {
            "$ref": "#/components/schemas/DeploymentEstimate"
          },
          "project": {
            "$ref": "#/components/schemas/ContractProject"
          },
          "taskId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContractPlanApproval": {
        "properties": {
          "project": {
            "$ref": "#/components/schemas/ContractProject"
          }
        },
        "type": "object"
      },
      "ContractProjectListItem": {
        "properties": {
          "allDeployments": {
            "items": {
              "$ref": "#/components/schemas/DeployResult"
            },
            "type": "array",
            "uniqueItems": false
          },
          "createdAt": {
            "type": "string"
          },
          "currentStep": {
            "type": "integer"
          },
          "deployments": {
            "$ref": "#/components/schemas/Deployments"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "solVersion": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ContractProjectStatus"
          },
          "testResults": {
            "$ref": "#/components/schemas/ContractTestSummary"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContractTestSummary": {
        "properties": {
          "failed": {
            "type": "integer"
          },
          "passed": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ConversationSnapshot": {
        "properties": {
          "isActive": {
            "description": "IsActive is true only when a turn is ACTIVELY running, derived from the\nLangGraph checkpoint (not the in-process lock). A turn paused at an\ninterrupt is NOT active — it is waiting for the user.",
            "type": "boolean"
          },
          "mode": {
            "description": "Mode is state.values.mode, or null."
          },
          "pendingInterrupt": {
            "description": "PendingInterrupt is the ASK / clarification / template_gate payload that\ndrives the \"Waiting for your input\" card, or null when nothing is pending.\nOpaque to Go — passed straight through from caddie to the FE."
          }
        },
        "type": "object"
      },
      "CountRunsByWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/WorkflowRunCountByWorkflow"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CountTemplateVersionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TemplateVersionCount"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CountWorkflowRunsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowRunCount"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CountWorkflowVersionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowVersionCount"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateAPIKeyData": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "key": {
            "description": "Key is the full plaintext API key, shown only once. Store it securely.",
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "lastUsedAt": {
            "type": "string"
          },
          "lastUsedIp": {
            "type": "string"
          },
          "lastUsedUserAgent": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "revokedAt": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/APIKeyScope"
          },
          "serviceAccountId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateAPIKeyParams": {
        "properties": {
          "description": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "serviceAccountId": {
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "CreateAPIKeySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CreateAPIKeyData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateCheckoutSessionParams": {
        "properties": {
          "interval": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          }
        },
        "required": ["tier"],
        "type": "object"
      },
      "CreateCheckoutSessionResponse": {
        "properties": {
          "clientSecret": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateConnectorParams": {
        "properties": {
          "data": {
            "additionalProperties": {},
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": ["data", "name", "type"],
        "type": "object"
      },
      "CreateConnectorSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Connector"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateExecutionData": {
        "properties": {
          "clientToken": {
            "type": "string"
          },
          "execution": {
            "$ref": "#/components/schemas/ExternalExecution"
          }
        },
        "type": "object"
      },
      "CreateExecutionParams": {
        "properties": {
          "clientSafeMetadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "externalRef": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "requestPayload": {
            "additionalProperties": {},
            "type": "object"
          },
          "sourceEntityId": {
            "type": "string"
          },
          "sourceEntityType": {
            "type": "string"
          },
          "sourceSystem": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "required": ["sourceEntityType", "sourceSystem", "workflowId"],
        "type": "object"
      },
      "CreateExecutionSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CreateExecutionData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateExecutionWebhookData": {
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/ExecutionWebhookEndpoint"
          },
          "signingSecret": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateExecutionWebhookParams": {
        "properties": {
          "description": {
            "type": "string"
          },
          "maxRetries": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "subscribedEventTypes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "url": {
            "type": "string"
          }
        },
        "required": ["name", "url"],
        "type": "object"
      },
      "CreateExecutionWebhookSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CreateExecutionWebhookData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreatePublicExecutionParams": {
        "properties": {
          "clientSafeMetadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "externalRef": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "requestPayload": {
            "additionalProperties": {},
            "type": "object"
          },
          "sourceEntityId": {
            "type": "string"
          },
          "sourceEntityType": {
            "type": "string"
          },
          "sourceSystem": {
            "type": "string"
          }
        },
        "required": ["sourceEntityType", "sourceSystem"],
        "type": "object"
      },
      "CreateServiceAccountParams": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["name", "permissions"],
        "type": "object"
      },
      "CreateSessionInstallResponse": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "expiresAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateSessionParams": {
        "properties": {
          "expiresAt": {
            "type": "string"
          },
          "installs": {
            "description": "Keep `max` in sync with MaxInstallsPerSession (validator tags must be literals).",
            "items": {
              "$ref": "#/components/schemas/SessionInstall"
            },
            "maxItems": 24,
            "minItems": 1,
            "type": "array",
            "uniqueItems": false
          },
          "policies": {
            "additionalProperties": {},
            "type": "object"
          },
          "sessionAddress": {
            "type": "string"
          },
          "walletId": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "required": [
          "expiresAt",
          "installs",
          "policies",
          "sessionAddress",
          "walletId"
        ],
        "type": "object"
      },
      "CreateSessionSuccessResponse": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "sessionAddress": {
            "type": "string"
          },
          "sessionGroupId": {
            "type": "string"
          },
          "sessions": {
            "items": {
              "$ref": "#/components/schemas/CreateSessionInstallResponse"
            },
            "type": "array",
            "uniqueItems": false
          },
          "walletId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateSetupIntentResponse": {
        "properties": {
          "clientSecret": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateWalletParams": {
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/WalletAccountParams"
            },
            "type": "array",
            "uniqueItems": false
          },
          "name": {
            "maxLength": 100,
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "CreateWorkflowParams": {
        "properties": {
          "conversationId": {
            "description": "Optional: conversation that created this workflow",
            "type": "string"
          },
          "cooldownMs": {
            "minimum": 1000,
            "type": "integer"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "type": "string"
          },
          "maxRuns": {
            "maximum": 99999,
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "sessionId": {
            "description": "Optional: migrate chat history from session to workflow",
            "type": "string"
          },
          "templateId": {
            "description": "Optional: template ID to track fork count",
            "type": "string"
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          }
        },
        "required": ["definition", "description", "name"],
        "type": "object"
      },
      "CreateWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Workflow"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateX402EndpointParams": {
        "properties": {
          "baseUrl": {
            "description": "Endpoint identity",
            "type": "string"
          },
          "bodyParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "category": {
            "maxLength": 50,
            "type": "string"
          },
          "defaultBody": {
            "additionalProperties": {},
            "type": "object"
          },
          "defaultHeaders": {
            "additionalProperties": {},
            "type": "object"
          },
          "defaultQueryParams": {
            "additionalProperties": {},
            "description": "Default values (applied if user doesn't provide at runtime)",
            "type": "object"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "exampleBody": {},
          "exampleOutput": {},
          "exampleQueryParams": {
            "additionalProperties": {},
            "description": "Examples (for AI/docs/UI)",
            "type": "object"
          },
          "headerParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "method": {
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "name": {
            "description": "Metadata (optional - AI generates if empty)",
            "maxLength": 100,
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "outputSchema": {
            "additionalProperties": {},
            "description": "Output schema",
            "type": "object"
          },
          "payTo": {
            "type": "string"
          },
          "price": {
            "description": "Payment info (from probe)",
            "type": "string"
          },
          "queryParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "description": "Input configuration (CDP-aligned flat structure)\nFormat: {\"paramName\": {\"type\": \"string\", \"description\": \"...\", \"required\": true}}",
            "type": "object"
          },
          "source": {
            "description": "user_import or cdp_bazaar",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": "array",
            "uniqueItems": false
          },
          "tokenAddress": {
            "type": "string"
          },
          "tokenDecimals": {
            "type": "integer"
          },
          "tokenSymbol": {
            "type": "string"
          }
        },
        "required": ["baseUrl", "network", "payTo", "price", "tokenAddress"],
        "type": "object"
      },
      "CreateX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/X402Endpoint"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreditsDepositBalanceChange": {
        "properties": {
          "new": {
            "type": "number"
          },
          "old": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "CreditsDepositParams": {
        "properties": {
          "amountPaidCents": {
            "description": "optional payment validation",
            "type": "integer"
          },
          "interval": {
            "description": "from subscription metadata",
            "type": "string"
          },
          "orgId": {
            "type": "string"
          },
          "referenceId": {
            "type": "string"
          },
          "resetBeforeDeposit": {
            "description": "default false = additive",
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "stripeCustomerId": {
            "description": "from invoice.paid event",
            "type": "string"
          },
          "stripeSubscriptionId": {
            "description": "from invoice.paid event",
            "type": "string"
          },
          "tier": {
            "type": "string"
          }
        },
        "required": ["orgId", "referenceId", "source", "tier"],
        "type": "object"
      },
      "CreditsDepositResponse": {
        "properties": {
          "aiBalance": {
            "$ref": "#/components/schemas/CreditsDepositBalanceChange"
          },
          "creditsInserted": {
            "type": "boolean"
          },
          "cuBalance": {
            "$ref": "#/components/schemas/CreditsDepositBalanceChange"
          }
        },
        "type": "object"
      },
      "DeepAgentsResponse": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "enabledAgents": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false,
            "x-nullable": true
          },
          "enabledPlatforms": {
            "description": "EnabledPlatforms is always an explicit list (never null): empty = web only.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "DefinitionSummary": {
        "properties": {
          "nodes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/NodeSummary"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "DeleteConnectorSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DeletePipedreamAccountSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DeploymentVerificationStatus": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "contractAddress": {
            "type": "string"
          },
          "explorerUrl": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "DiscordConnectorServer": {
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "DowngradeStripeSubscriptionParams": {
        "properties": {
          "interval": {
            "type": "string"
          },
          "newTier": {
            "type": "string"
          }
        },
        "required": ["newTier"],
        "type": "object"
      },
      "DowngradeStripeSubscriptionResponse": {
        "properties": {
          "effectiveAt": {
            "type": "string"
          },
          "newTier": {
            "type": "string"
          },
          "oldTier": {
            "type": "string"
          },
          "subscriptionId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EphemeralRunParams": {
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "payload": {
            "additionalProperties": {},
            "description": "Payload is merged into the trigger result (root node output),\naccessible via {{root.result.key}} expressions. A \"triggeredAt\"\ntimestamp is always added automatically.",
            "type": "object"
          },
          "propValues": {
            "additionalProperties": {},
            "description": "PropValues are template parameter values injected into the run\ncontext, accessible via {{$props.key}} expressions.",
            "type": "object"
          },
          "runId": {
            "description": "RunID is an optional client-generated run ID. Must start with\n\"run_\" prefix. If omitted, a run ID is generated server-side.\nUse this to subscribe to SSE stream before triggering the run.",
            "example": "run_abc123",
            "type": "string"
          }
        },
        "required": ["definition"],
        "type": "object"
      },
      "ExecuteQueryParams": {
        "properties": {
          "params": {
            "items": {},
            "maxItems": 100,
            "type": "array",
            "uniqueItems": false
          },
          "sql": {
            "maxLength": 10000,
            "type": "string"
          }
        },
        "required": ["sql"],
        "type": "object"
      },
      "ExecuteX402EndpointParams": {
        "properties": {
          "body": {
            "additionalProperties": {},
            "type": "object"
          },
          "method": {
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
            "type": "string"
          },
          "paymentHeader": {
            "description": "Base64-encoded X-PAYMENT from browser signing",
            "type": "string"
          },
          "resourceUrl": {
            "type": "string"
          }
        },
        "required": ["paymentHeader", "resourceUrl"],
        "type": "object"
      },
      "ExecuteX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TestX402EndpointData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExecutionStatsData": {
        "properties": {
          "granularity": {
            "type": "string"
          },
          "recentFailures": {
            "items": {
              "$ref": "#/components/schemas/RecentExecutionFailure"
            },
            "type": "array",
            "uniqueItems": false
          },
          "sourceSystems": {
            "items": {
              "$ref": "#/components/schemas/ExecutionSourceSystemStat"
            },
            "type": "array",
            "uniqueItems": false
          },
          "statuses": {
            "items": {
              "$ref": "#/components/schemas/ExecutionStatusCount"
            },
            "type": "array",
            "uniqueItems": false
          },
          "summary": {
            "$ref": "#/components/schemas/ExecutionStatsSummary"
          },
          "timeSeries": {
            "items": {
              "$ref": "#/components/schemas/ExecutionTimeSeriesPoint"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "GenerateSeoPagesParams": {
        "properties": {
          "dryRun": {
            "type": "boolean"
          },
          "regenerate": {
            "type": "boolean"
          },
          "skipAI": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "GenerateSeoPagesSuccessResponse": {
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GenerateTelegramPinSuccessResponse": {
        "properties": {
          "botUsername": {
            "type": "string"
          },
          "dmLink": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "groupLink": {
            "type": "string"
          },
          "pin": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GenerateX402MetadataData": {
        "properties": {
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "GenerateX402MetadataParams": {
        "properties": {
          "exampleInput": {},
          "exampleOutput": {},
          "inputSchema": {
            "additionalProperties": {},
            "type": "object"
          },
          "method": {
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "outputSchema": {
            "additionalProperties": {},
            "type": "object"
          },
          "price": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string"
          },
          "tokenSymbol": {
            "type": "string"
          }
        },
        "required": ["resourceUrl"],
        "type": "object"
      },
      "GenerateX402MetadataSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GenerateX402MetadataData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetAICreditUsageSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/AICreditUsageSummaryPublic"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetAPIKeySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/APIKey"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetActionSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ActionDefinition"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetAgentRunSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/AgentRunData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetAllStatisticsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/NodeStatistics"
            },
            "type": "object"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetCUBalanceSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CUGetBalanceResult"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetCUCostsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CUCostsResult"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetCURunsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-CURunItem"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetCUUsageByWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CUUsageByWorkflowResult"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetCUUsageSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CUUsageSummary"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetChatDebugDataSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetChatHistorySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetConnectTokenSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PipedreamConnectToken"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetConnectorSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Connector"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetConnectorTypeSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ConnectorDefinition"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetContractProjectSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ContractProject"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetConversationSnapshotSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ConversationSnapshot"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetDeepAgentsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/DeepAgentsResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetDiscordConnectorServerSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/DiscordConnectorServer"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetExecutionData": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/ExternalExecutionEvent"
            },
            "type": "array",
            "uniqueItems": false
          },
          "execution": {
            "$ref": "#/components/schemas/ExternalExecution"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetExecutionEventsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ExternalExecutionEvent"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetExecutionStatsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ExecutionStatsData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetExecutionSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GetExecutionData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetFailureRateSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/FailureRateStats"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetLatencyTimeSeriesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/LatencyTimeSeriesData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetMetricsSummarySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/MetricsSummaryData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetOnboardingQuestionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-OnboardingQuestionResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetOnboardingStatusSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/OnboardingStatusResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetOrgWebhookSecretSuccessResponse": {
        "properties": {
          "secret": {
            "type": "string"
          },
          "webhookUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetOutboundWebhookDeliverySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/OutboundWebhookDelivery"
          },
          "message": {
            "example": "Success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPipedreamAccountSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PipedreamAccount"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPlanOptionsResponse": {
        "properties": {
          "currentInterval": {
            "type": "string"
          },
          "currentTier": {
            "type": "string"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/PlanOption"
            },
            "type": "array",
            "uniqueItems": false
          },
          "periodEnd": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicExecutionSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PublicExecutionData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicMetaResponse": {
        "properties": {
          "description": {
            "description": "Description is a short summary of what the workflow does.",
            "type": "string"
          },
          "name": {
            "description": "Name is the display name of the workflow.",
            "type": "string"
          },
          "workflowId": {
            "description": "WorkflowID is the workflow identifier.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicMetaSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GetPublicMetaResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicRunByTxResponse": {
        "properties": {
          "executionState": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PublicNodeState"
            },
            "description": "Current state of each node",
            "type": "object"
          },
          "finishedAt": {
            "type": "string"
          },
          "nodes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PublicWorkflowNode"
            },
            "description": "Step-by-step execution data",
            "type": "object"
          },
          "runId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "description": "\"running\", \"success\", \"failure\"",
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicRunByTxSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GetPublicRunByTxResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicRunSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GetPublicRunByTxResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicWidgetResponse": {
        "properties": {
          "widget": {
            "$ref": "#/components/schemas/PublicWidgetData"
          },
          "workflowId": {
            "description": "WorkflowID is the workflow identifier",
            "type": "string"
          },
          "workflowName": {
            "description": "WorkflowName is the display name of the workflow",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicWidgetSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GetPublicWidgetResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPublicWorkflowData": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "visibility": {
            "$ref": "#/components/schemas/WorkflowVisibility"
          }
        },
        "type": "object"
      },
      "GetPublicWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/GetPublicWorkflowData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetRecentActivitySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/RecentRun"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetRunSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Run"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetRunsTimeSeriesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/RunsTimeSeriesData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetSeoPageSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/SeoIntegrationPage"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetServiceAccountSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ServiceAccount"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetStripeBillingDetailsResponse": {
        "properties": {
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/BillingInvoiceResponse"
            },
            "type": "array",
            "uniqueItems": false
          },
          "paymentMethods": {
            "items": {
              "$ref": "#/components/schemas/BillingPaymentMethodResponse"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "GetTemplateVersionSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Template"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetTopErrorsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/TopError"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetTriggerInfoSuccessResponse": {
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TriggerInfoResponse"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetTriggerSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TriggerDefinition"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetUsageTimeSeriesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/UsageTimeSeriesData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Workflow"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetWorkflowVersionSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Workflow"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/X402Endpoint"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ImportWalletParams": {
        "properties": {
          "address": {
            "type": "string"
          },
          "name": {
            "maxLength": 100,
            "type": "string"
          },
          "turnkeyPrivateKeyId": {
            "type": "string"
          }
        },
        "required": ["address", "name", "turnkeyPrivateKeyId"],
        "type": "object"
      },
      "ImportX402EndpointData": {
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/X402Endpoint"
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/TestX402PaymentDetails"
          }
        },
        "type": "object"
      },
      "ImportX402EndpointParams": {
        "properties": {
          "body": {
            "additionalProperties": {},
            "type": "object"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "method": {
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
            "type": "string"
          },
          "name": {
            "description": "Optional: User can override AI-generated values",
            "maxLength": 100,
            "type": "string"
          },
          "resourceUrl": {
            "type": "string"
          },
          "walletAddress": {
            "description": "Optional: Specify which wallet to use for payment.\nIf not provided, uses the organization's default wallet.",
            "type": "string"
          }
        },
        "required": ["resourceUrl"],
        "type": "object"
      },
      "ImportX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ImportX402EndpointData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "IncentiveGrantedDTO": {
        "properties": {
          "ai_credits_granted": {
            "type": "string"
          },
          "cu_granted": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "IncentiveStateResponse": {
        "properties": {
          "org_id": {
            "type": "string"
          },
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/IncentiveTaskDTO"
            },
            "type": "array",
            "uniqueItems": false
          },
          "totals": {
            "$ref": "#/components/schemas/IncentiveTotalsDTO"
          },
          "user_id": {
            "description": "UserID is the caller's resolved user identifier — surfaced so the\nfrontend can scope per-user client state (e.g., the Path B\nlocalStorage gate) without a separate /me round trip.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "IncentiveTaskDTO": {
        "properties": {
          "claimed_at": {
            "description": "claimed_at + claimed_by intentionally NOT omitempty — emit `null` for\npending tasks so the TS frontend gets a stable shape (`string | null`,\nnever `undefined`). See useIncentiveState.ts type IncentiveTaskState.",
            "type": "string"
          },
          "claimed_by": {
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "reward_ai_credits": {
            "type": "integer"
          },
          "reward_cu": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "IncentiveTotalsDTO": {
        "properties": {
          "ai_earned": {
            "type": "string"
          },
          "ai_max": {
            "type": "integer"
          },
          "completion_pct": {
            "type": "number"
          },
          "cu_earned": {
            "description": "decimal as string",
            "type": "string"
          },
          "cu_max": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "IncentiveVerifyRequest": {
        "properties": {
          "task_type": {
            "type": "string"
          }
        },
        "required": ["task_type"],
        "type": "object"
      },
      "IncentiveVerifyResponse": {
        "properties": {
          "already": {
            "type": "boolean"
          },
          "granted": {
            "$ref": "#/components/schemas/IncentiveGrantedDTO"
          },
          "metadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "description": "ReasonCode is the typed bucket the verifier set on a failure\n(FailureClass enum, see incentive/types.go). Frontend should branch on\nthis typed value rather than substring-matching `Reason` copy.\nEmpty when Status=\"claimed\".",
            "type": "string"
          },
          "status": {
            "description": "\"claimed\" | \"pending\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "InternalSubscriptionCancelParams": {
        "properties": {
          "customerOrgId": {
            "type": "string"
          }
        },
        "required": ["customerOrgId"],
        "type": "object"
      },
      "InternalSubscriptionCancelResponse": {
        "properties": {
          "newTier": {
            "type": "string"
          },
          "oldTier": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LatencyTimeSeriesData": {
        "properties": {
          "actionId": {
            "description": "e.g., \"send-erc20-token\"",
            "type": "string"
          },
          "data": {
            "description": "Time-series data points",
            "items": {
              "$ref": "#/components/schemas/LatencyTimeSeriesPoint"
            },
            "type": "array",
            "uniqueItems": false
          },
          "granularity": {
            "description": "\"hourly\" or \"daily\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LatestAppBuild": {
        "properties": {
          "appUrl": {
            "type": "string"
          },
          "buildId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LatestAppBuildResponse": {
        "properties": {
          "build": {
            "$ref": "#/components/schemas/LatestAppBuild"
          }
        },
        "type": "object"
      },
      "LatestAppBuildSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/LatestAppBuildResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LatestPricesTokenPriceCexesSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/StorkLatestPricesResponse"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListAPIKeysSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-APIKey"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListAPIRequestAuditsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-APIRequestAudit"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListActionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ActionDefinition"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListAgentArtifactsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-AgentArtifactItem"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListAgentRunHistorySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-AgentRunHistoryItem"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListAgentTypesResponse": {
        "properties": {
          "agents": {
            "items": {
              "$ref": "#/components/schemas/AgentTypeInfo"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "ListAgentTypesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ListAgentTypesResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListCaddieMemoryResponse": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaddieMemoryItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "orgEnabled": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ListCaddieMemorySuccessResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ListCaddieMemoryResponse"
          }
        },
        "type": "object"
      },
      "ListChatSessionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-ChatSession"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListConnectorTypesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ConnectorDefinition"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListConnectorsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-Connector"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListContractProjectsSlimSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-ContractProjectListItem"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListExecutionWebhookDeliveriesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-ExecutionWebhookDelivery"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListExecutionWebhooksSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-ExecutionWebhookEndpoint"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListExecutionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-ExternalExecution"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListInvitesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-InviteWithOrgName"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListLogicActionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ActionDefinition"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListMembersSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-OrganizationMember"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListOrgInvitesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-OrganizationInvite"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListOrganizationsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-Organization"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListOutboundWebhookDeliveriesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-OutboundWebhookDelivery"
          },
          "message": {
            "example": "Success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListPipedreamActionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/PipedreamAction"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListPipedreamAppsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/PipedreamApp"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListPublicRunsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-PublicRunListItem"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListRunVariableWritesResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-VariableWrite"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListRunsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-RunListItem"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListSMSNumbersSuccessResponse": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SMSVerifiedNumber"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ListSeoPagesData": {
        "properties": {
          "pages": {
            "items": {
              "$ref": "#/components/schemas/SeoIntegrationPage"
            },
            "type": "array",
            "uniqueItems": false
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ListSeoPagesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ListSeoPagesData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListServiceAccountsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-ServiceAccount"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListSessionsSuccessResponse": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SessionItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ListSituationUniverseSuccessResponse": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SituationUniverseTicker"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ListTelegramChatsSuccessResponse": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/TelegramVerifiedChat"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ListTemplateVersionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TemplateVersionsData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListTiersResponse": {
        "properties": {
          "tiers": {
            "items": {
              "$ref": "#/components/schemas/TierResponse"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "ListTriggersSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/TriggerDefinition"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListUserInterestsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-UserInterest"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListVariableHistoryResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-VariableWrite"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListWalletsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-WalletResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListWorkflowVariablesResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VariableValueWithMeta"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "ListWorkflowVersionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowVersionsData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListWorkflowsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-WorkflowListItem"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListX402EndpointsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-X402Endpoint"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "McpListConnectorsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PaginatedData-McpConnectorView"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "McpOAuthURLSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "McpServersCatalogSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {},
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "MetricsSummaryData": {
        "properties": {
          "failureRate": {
            "$ref": "#/components/schemas/FailureRateStats"
          },
          "failureRateError": {
            "type": "string"
          },
          "recentActivity": {
            "items": {
              "$ref": "#/components/schemas/RecentRun"
            },
            "type": "array",
            "uniqueItems": false
          },
          "recentActivityError": {
            "type": "string"
          },
          "runsTimeSeries": {
            "$ref": "#/components/schemas/RunsTimeSeriesData"
          },
          "runsTimeSeriesError": {
            "type": "string"
          },
          "topErrors": {
            "items": {
              "$ref": "#/components/schemas/TopError"
            },
            "type": "array",
            "uniqueItems": false
          },
          "topErrorsError": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "NodeSummary": {
        "properties": {
          "branch": {
            "type": "string"
          },
          "children": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "position": {
            "$ref": "#/components/schemas/Position"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OnboardingQuestionResponse": {
        "properties": {
          "id": {
            "example": "onboarding_q1",
            "type": "string"
          },
          "isRequired": {
            "example": true,
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "questionOrder": {
            "example": 1,
            "type": "integer"
          },
          "questionText": {
            "example": "What brings you to B3OS?",
            "type": "string"
          },
          "questionType": {
            "example": "text",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OnboardingResponseRequest": {
        "properties": {
          "questionId": {
            "type": "string"
          },
          "responseData": {
            "additionalProperties": {},
            "type": "object"
          },
          "responseType": {
            "type": "string"
          }
        },
        "required": ["questionId", "responseData", "responseType"],
        "type": "object"
      },
      "OnboardingStatusResponse": {
        "properties": {
          "completedAt": {
            "example": "2024-01-21T10:30:00Z",
            "type": "string"
          },
          "onboardingCompleted": {
            "example": false,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PaginatedData-McpConnectorView": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/McpConnectorView"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-APIKey": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/APIKey"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-APIRequestAudit": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/APIRequestAudit"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-CURunItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CURunItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-Connector": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Connector"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-ExecutionWebhookDelivery": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ExecutionWebhookDelivery"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-ExecutionWebhookEndpoint": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ExecutionWebhookEndpoint"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-ExternalExecution": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ExternalExecution"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-InviteWithOrgName": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/InviteWithOrgName"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-Organization": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Organization"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-OrganizationInvite": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/OrganizationInvite"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-OrganizationMember": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/OrganizationMember"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-OutboundWebhookDelivery": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/OutboundWebhookDelivery"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-RunListItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/RunListItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-ServiceAccount": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ServiceAccount"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-VariableWrite": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/VariableWrite"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-X402Endpoint": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/X402Endpoint"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-AgentArtifactItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/AgentArtifactItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-AgentRunHistoryItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/AgentRunHistoryItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-ChatSession": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChatSession"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-ContractProjectListItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ContractProjectListItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-OnboardingQuestionResponse": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/OnboardingQuestionResponse"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-PublicRunListItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/PublicRunListItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-UserInterest": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/UserInterest"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-WalletResponse": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/WalletResponse"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaginatedData-WorkflowListItem": {
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/WorkflowListItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PipedreamAccount": {
        "properties": {
          "appName": {
            "type": "string"
          },
          "appSlug": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "healthy": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PipedreamAction": {
        "properties": {
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PipedreamApp": {
        "properties": {
          "authType": {
            "type": "string"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "imgSrc": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "nameSlug": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PipedreamConnectToken": {
        "properties": {
          "expiresAt": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PlanOption": {
        "properties": {
          "action": {
            "$ref": "#/components/schemas/PlanOptionAction"
          },
          "effectiveAt": {
            "type": "string"
          },
          "interval": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PlanOptionAction": {
        "enum": ["upgrade", "downgrade", "cancel"],
        "type": "string",
        "x-enum-varnames": [
          "PlanOptionActionUpgrade",
          "PlanOptionActionDowngrade",
          "PlanOptionActionCancel"
        ]
      },
      "Position": {
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "PreflightChatResponse": {
        "properties": {
          "allowed": {
            "description": "Allowed is false when the org has no AI credits left (ledger balance <= 0).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PreviewUpgradeResponse": {
        "properties": {
          "previews": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PreviewUpgradeTierResult"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "PreviewUpgradeTierResult": {
        "properties": {
          "amountDueCents": {
            "description": "net charge today",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ProbeX402EndpointParams": {
        "properties": {
          "body": {
            "description": "Optional body to send with the probe request.\nSome endpoints require valid input before returning 402.",
            "type": "string"
          },
          "method": {
            "description": "Optional HTTP method to use. If not specified, tries POST then GET.\nValid values: GET, POST, PUT, PATCH, DELETE",
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
            "type": "string"
          },
          "resourceUrl": {
            "type": "string"
          }
        },
        "required": ["resourceUrl"],
        "type": "object"
      },
      "ProbeX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/X402EndpointProbeResult"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicExecutionData": {
        "properties": {
          "checkoutSessionId": {
            "type": "string"
          },
          "clientSafeMetadata": {
            "additionalProperties": {},
            "type": "object"
          },
          "createdAt": {
            "type": "string"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/PublicExecutionEvent"
            },
            "type": "array",
            "uniqueItems": false
          },
          "finishedAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ExternalExecutionStatus"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicExecutionEvent": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicNodeState": {
        "properties": {
          "finishedAt": {
            "description": "When execution finished",
            "type": "string"
          },
          "startedAt": {
            "description": "When execution started",
            "type": "string"
          },
          "status": {
            "description": "\"pending\", \"running\", \"success\", \"failure\", \"skipped\"",
            "type": "string"
          },
          "type": {
            "description": "Node type (e.g., \"erc20-receive\", \"send-slack-message\")",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicRunListItem": {
        "properties": {
          "finishedAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicWidgetData": {
        "description": "Widget contains the public widget configuration with derived trigger values",
        "properties": {
          "buttonLabel": {
            "description": "ButtonLabel is the text displayed on the trigger button",
            "type": "string"
          },
          "chainId": {
            "description": "ChainID is derived from the trigger's chainId",
            "type": "integer"
          },
          "description": {
            "description": "Description explains what the workflow does",
            "type": "string"
          },
          "enabled": {
            "description": "Enabled controls whether the public widget is active",
            "type": "boolean"
          },
          "maxAmount": {
            "description": "MaxAmount is the maximum amount allowed per trigger (in smallest unit)",
            "type": "string"
          },
          "minAmount": {
            "description": "MinAmount is the minimum amount required to trigger (in smallest unit)",
            "type": "string"
          },
          "recipientAddress": {
            "description": "RecipientAddress is derived from the trigger's toAddress/contractAddress",
            "type": "string"
          },
          "title": {
            "description": "Title is the display title for the widget",
            "type": "string"
          },
          "tokenAddress": {
            "description": "TokenAddress is derived from the trigger's tokenAddress (empty for native token)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicWorkflowNode": {
        "properties": {
          "children": {
            "description": "Child node IDs",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "loopBody": {
            "description": "Loop body node IDs (for-each only)",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "type": {
            "description": "Node type",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublishReleaseParams": {
        "properties": {
          "expectedVersion": {
            "description": "ExpectedVersion, when set, makes the workflow publish step fail with a\nversion conflict if the draft has moved on — optimistic locking,\nmirrors PublishWorkflowParams.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PublishWidgetParams": {
        "properties": {
          "buttonLabel": {
            "description": "ButtonLabel is the text displayed on the trigger button (optional, defaults to \"Send\")",
            "maxLength": 50,
            "type": "string"
          },
          "description": {
            "description": "Description explains what the workflow does (optional)",
            "maxLength": 500,
            "type": "string"
          },
          "maxAmount": {
            "description": "MaxAmount is the maximum amount allowed per trigger (optional)",
            "type": "string"
          },
          "minAmount": {
            "description": "MinAmount is the minimum amount required to trigger (optional)",
            "type": "string"
          },
          "title": {
            "description": "Title is the display title for the widget (required)",
            "maxLength": 100,
            "type": "string"
          }
        },
        "required": ["title"],
        "type": "object"
      },
      "PublishWidgetSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/PublicWidgetData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublishWorkflowParams": {
        "properties": {
          "expectedVersion": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "QueryResponse": {
        "properties": {
          "rows": {
            "items": {
              "additionalProperties": {},
              "type": "object"
            },
            "type": "array",
            "uniqueItems": false
          },
          "rowsAffected": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ReactivateSubscriptionResponse": {
        "properties": {
          "subscriptionId": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RecentRunItem": {
        "properties": {
          "finishedAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RecommendTemplatesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Template"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RefillWorkflowData": {
        "properties": {
          "remainRuns": {
            "type": "integer"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RefillWorkflowParams": {
        "properties": {
          "remainRuns": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": ["remainRuns"],
        "type": "object"
      },
      "RefillWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/RefillWorkflowData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RegenerateDescriptionsData": {
        "properties": {
          "aiDescription": {
            "type": "string"
          },
          "aiName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RegenerateDescriptionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/RegenerateDescriptionsData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RenameWalletParams": {
        "properties": {
          "name": {
            "maxLength": 100,
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "ReplayExecutionWebhookDeliverySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ExecutionWebhookDelivery"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReplayOutboundWebhookDeliverySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/OutboundWebhookDelivery"
          },
          "message": {
            "example": "Success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReportChatUsageParams": {
        "properties": {
          "braintrustSpanId": {
            "description": "BraintrustSpanID is the turn's Braintrust span id, persisted to the\nledger so the admin dashboard can deep-link a charge to its trace.",
            "maxLength": 255,
            "type": "string"
          },
          "conversationId": {
            "maxLength": 255,
            "type": "string"
          },
          "costUsd": {
            "minimum": 0,
            "type": "number"
          },
          "inputTokens": {
            "minimum": 0,
            "type": "integer"
          },
          "model": {
            "maxLength": 100,
            "type": "string"
          },
          "outputTokens": {
            "minimum": 0,
            "type": "integer"
          },
          "requestId": {
            "maxLength": 100,
            "type": "string"
          }
        },
        "required": ["requestId"],
        "type": "object"
      },
      "ResolveWorkflowResponse": {
        "properties": {
          "isMember": {
            "type": "boolean"
          },
          "organizationId": {
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResolveWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ResolveWorkflowResponse"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RetryExecutionWebhookDeliverySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ExecutionWebhookDelivery"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RetryOutboundWebhookDeliverySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/OutboundWebhookDelivery"
          },
          "message": {
            "example": "Success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RevertToVersionParams": {
        "properties": {
          "workflowVersion": {
            "description": "WorkflowVersion is the workflow version to revert to. The resulting\nrelease records this version.",
            "type": "integer"
          }
        },
        "required": ["workflowVersion"],
        "type": "object"
      },
      "RevokeAPIKeySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RevokeSessionSuccessResponse": {
        "properties": {
          "id": {
            "type": "string"
          },
          "revokedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RollbackTemplateParams": {
        "properties": {
          "targetVersion": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": ["targetVersion"],
        "type": "object"
      },
      "RollbackTemplateSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Template"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RollbackWorkflowParams": {
        "properties": {
          "expectedCurrentVersion": {
            "minimum": 1,
            "type": "integer"
          },
          "targetVersion": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": ["targetVersion"],
        "type": "object"
      },
      "RollbackWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Workflow"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RunActionParams": {
        "properties": {
          "connectorId": {
            "type": "string"
          },
          "inputs": {
            "additionalProperties": {},
            "type": "object"
          }
        },
        "required": ["inputs"],
        "type": "object"
      },
      "RunActionResponse": {
        "properties": {
          "durationMs": {
            "type": "integer"
          },
          "result": {
            "additionalProperties": {},
            "type": "object"
          }
        },
        "type": "object"
      },
      "RunParams": {
        "properties": {
          "chatMessageId": {
            "description": "Optional assistant chat message that launched this run.",
            "type": "string"
          },
          "dustTest": {
            "description": "When true, run with auto-calculated dust amounts (~$0.01 USD).\nMutually exclusive with Simulate.",
            "type": "boolean"
          },
          "payload": {
            "additionalProperties": {},
            "description": "Optional payload",
            "type": "object"
          },
          "runId": {
            "description": "Optional run ID. If provided, must start with \"run_\" prefix.\nUse this to subscribe to SSE stream before triggering the run.",
            "type": "string"
          },
          "simulate": {
            "description": "When true, run the workflow in simulation mode (dry-run).",
            "type": "boolean"
          },
          "triggerNodeId": {
            "description": "For multi-trigger (\"forest\") workflows: which trigger node should be\nrecorded as the firing trigger for this run. Optional — when omitted\nthe workflow's manual trigger is resolved by type, matching the\nhistorical single-trigger behavior. The trigger picker in the editor\nsends this so the resulting run is attributed to the trigger the user\nactually clicked.",
            "type": "string"
          },
          "version": {
            "description": "Optional version number. When set, run this specific version instead of\nthe default (which prioritizes draft). Useful for testing the live version\nwhile a draft exists.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RunResponse": {
        "properties": {
          "runId": {
            "example": "run_c9i6j8k2l0m3",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RunSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/RunResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RunTransactionAttribution": {
        "properties": {
          "actionType": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "runStatus": {
            "type": "string"
          },
          "startedAt": {
            "type": "string"
          },
          "txHash": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          },
          "workflowName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RunTransactionAttributionsRequest": {
        "properties": {
          "txHashes": {
            "items": {
              "type": "string"
            },
            "maxItems": 200,
            "minItems": 1,
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["txHashes"],
        "type": "object"
      },
      "RunTransactionAttributionsResponse": {
        "additionalProperties": {
          "$ref": "#/components/schemas/RunTransactionAttribution"
        },
        "type": "object"
      },
      "RunTransactionAttributionsSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/RunTransactionAttributionsResponse"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RunsTimeSeriesData": {
        "properties": {
          "data": {
            "description": "Time-series data points",
            "items": {
              "$ref": "#/components/schemas/RunsTimeSeriesPoint"
            },
            "type": "array",
            "uniqueItems": false
          },
          "granularity": {
            "description": "\"hourly\" or \"daily\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SMSInitiateVerifyRequest": {
        "properties": {
          "phoneNumber": {
            "type": "string"
          }
        },
        "required": ["phoneNumber"],
        "type": "object"
      },
      "SMSInitiateVerifySuccessResponse": {
        "properties": {
          "code": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "sendToPhone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SMSSendCodeRequest": {
        "properties": {
          "phoneNumber": {
            "type": "string"
          }
        },
        "required": ["phoneNumber"],
        "type": "object"
      },
      "SMSSendCodeSuccessResponse": {
        "properties": {
          "expiresAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SMSVerifyStatusSuccessResponse": {
        "properties": {
          "phoneNumber": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SaveChatDebugDataParams": {
        "properties": {
          "agentVersion": {
            "description": "Caddie lane that produced this debug payload (defaults to v2 when empty)",
            "enum": ["v1", "v2", "v3"],
            "type": "string"
          },
          "conversationId": {
            "description": "Stable conversation identifier (preferred)",
            "maxLength": 255,
            "type": "string"
          },
          "debugData": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "sessionId": {
            "description": "Metadata: which create-page session",
            "maxLength": 255,
            "type": "string"
          },
          "workflowId": {
            "description": "Metadata: which workflow",
            "maxLength": 50,
            "type": "string"
          }
        },
        "required": ["debugData"],
        "type": "object"
      },
      "SaveChatMessageParams": {
        "properties": {
          "agentVersion": {
            "description": "empty defaults to v2 at the column level",
            "enum": ["v1", "v2", "v3"],
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "conversationId": {
            "maxLength": 255,
            "type": "string"
          },
          "createdAt": {
            "description": "CreatedAt lets the caller stamp the row's timestamp explicitly. caddie sets\nit on the USER row to the moment the message was received (turn start), so\nits created_at reflects when the user actually sent it rather than the\nturn-end persist moment (the assistant row omits it → DB now()). Nil → the\nchat_messages.created_at column default (now()) applies.",
            "type": "string"
          },
          "role": {
            "enum": ["user", "assistant", "system", "context"],
            "type": "string"
          },
          "structuredPayload": {
            "description": "Phase 2A typed payload — persisted to chat_messages.structured_payload (bounded by caddie)",
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "turnId": {
            "maxLength": 50,
            "type": "string"
          },
          "workflowId": {
            "maxLength": 50,
            "type": "string"
          }
        },
        "required": ["content", "conversationId", "role"],
        "type": "object"
      },
      "SearchHit": {
        "properties": {
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "type": {
            "type": "string"
          },
          "workflowType": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SearchResponse": {
        "properties": {
          "processingTimeMs": {
            "type": "integer"
          },
          "query": {
            "type": "string"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/SearchHit"
            },
            "type": "array",
            "uniqueItems": false
          },
          "totalHits": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SessionInstall": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "serialized": {
            "type": "string"
          }
        },
        "required": ["chainId", "serialized"],
        "type": "object"
      },
      "SessionItem": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "policies": {
            "additionalProperties": {},
            "type": "object"
          },
          "sessionAddress": {
            "type": "string"
          },
          "walletId": {
            "type": "string"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SetWorkflowVariableValueParams": {
        "properties": {
          "value": {}
        },
        "type": "object"
      },
      "SetupDepositWalletResponse": {
        "properties": {
          "depositWalletAddress": {
            "type": "string"
          },
          "walletId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SituationUniverseTicker": {
        "properties": {
          "exchange": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StartAgentRunParams": {
        "properties": {
          "agentType": {
            "description": "AgentType selects which registered first-party agent to run. Required —\nthe caller picks one from GET /v1/agent-runs/agents (the worker's\nenabled-agent discovery list). There is no default: routing an empty type\nto a fixed agent risks dispatching to a disabled one (an opaque 403).",
            "type": "string"
          },
          "conversationId": {
            "description": "Optional. Threads the run into an existing agent conversation; when empty\nthe server generates a fresh conversation id (an independent thread).",
            "type": "string"
          },
          "parentProject": {
            "description": "ParentProject is the Braintrust project the parent span lives in (span\nnesting is project-scoped). Only meaningful together with ParentSpan.",
            "type": "string"
          },
          "parentSpan": {
            "description": "ParentSpan is an opaque Braintrust span slug (span.export()) of the\ncalling conversation's current span. Passed through verbatim to the\nruntime worker so the deep-agent run's trace attaches under the parent\nCaddie chat's Braintrust trace. Optional; observability only — never\naffects run behavior.",
            "type": "string"
          },
          "payload": {
            "additionalProperties": {},
            "description": "Payload is agent-type-specific input passed opaquely to the runtime\n(e.g. app-builder build params: workflowId, manifest, archetypeHint,\nparentBuildId, recentBuilds). workflow-builder ignores it.",
            "type": "object"
          },
          "prompt": {
            "type": "string"
          }
        },
        "required": ["agentType", "prompt"],
        "type": "object"
      },
      "StartAgentRunResponse": {
        "properties": {
          "agentType": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StartAgentRunSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/StartAgentRunResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SubmitContactFormRequest": {
        "properties": {
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "required": ["email", "firstName", "lastName", "message"],
        "type": "object"
      },
      "SubmitContactFormResponse": {
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SubmitContactFormSuccessResponse": {
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/SubmitContactFormResponse"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SubmitOnboardingResponsesParams": {
        "properties": {
          "responses": {
            "items": {
              "$ref": "#/components/schemas/OnboardingResponseRequest"
            },
            "minItems": 1,
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["responses"],
        "type": "object"
      },
      "SubmitOnboardingResponsesSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "message": {
            "example": "Onboarding completed successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SyncRunParams": {
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "payload": {
            "additionalProperties": {},
            "type": "object"
          },
          "propValues": {
            "additionalProperties": {},
            "type": "object"
          }
        },
        "required": ["definition"],
        "type": "object"
      },
      "SyncRunResponse": {
        "properties": {
          "durationMs": {
            "type": "integer"
          },
          "executionState": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ExecutionNode"
            },
            "type": "object"
          },
          "runId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TableInfo": {
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateVersionCount": {
        "properties": {
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TemplateVersionsData": {
        "properties": {
          "currentVersion": {
            "type": "integer"
          },
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Template"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TestActionData": {
        "properties": {
          "actionType": {
            "type": "string"
          },
          "cuCost": {
            "type": "integer"
          },
          "error": {
            "$ref": "#/components/schemas/ActionTestError"
          },
          "executionTimeMs": {
            "type": "integer"
          },
          "requiresGas": {
            "type": "boolean"
          },
          "result": {
            "additionalProperties": {},
            "type": "object"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TestActionParams": {
        "properties": {
          "connector": {
            "$ref": "#/components/schemas/ConnectorReference"
          },
          "inputs": {
            "additionalProperties": {},
            "type": "object"
          }
        },
        "required": ["inputs"],
        "type": "object"
      },
      "TestActionSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TestActionData"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TestX402EndpointData": {
        "description": "Reuse same response structure",
        "properties": {
          "error": {
            "type": "string"
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/TestX402PaymentDetails"
          },
          "resource": {},
          "statusCode": {
            "type": "integer"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TestX402EndpointParams": {
        "properties": {
          "body": {
            "additionalProperties": {},
            "type": "object"
          },
          "method": {
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
            "type": "string"
          },
          "resourceUrl": {
            "type": "string"
          }
        },
        "required": ["resourceUrl"],
        "type": "object"
      },
      "TestX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TestX402EndpointData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TestX402PaymentDetails": {
        "properties": {
          "amountPaid": {
            "type": "string"
          },
          "asset": {
            "description": "Token address used for payment",
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "payer": {
            "type": "string"
          },
          "transaction": {
            "description": "May be null if server doesn't return it",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TierResponse": {
        "properties": {
          "aiCredits": {
            "type": "integer"
          },
          "annualPriceUSDCents": {
            "type": "integer"
          },
          "cuAmount": {
            "type": "integer"
          },
          "maxActiveWorkflows": {
            "type": "integer"
          },
          "maxDatabaseTables": {
            "type": "integer"
          },
          "maxUsers": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "priceUSDCents": {
            "type": "integer"
          },
          "supportLevel": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TransferWorkflowOwnershipData": {
        "properties": {
          "id": {
            "type": "string"
          },
          "ownerUserId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TransferWorkflowOwnershipParams": {
        "properties": {
          "ownerUserId": {
            "type": "string"
          }
        },
        "required": ["ownerUserId"],
        "type": "object"
      },
      "TransferWorkflowOwnershipSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/TransferWorkflowOwnershipData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TriggerInfoResponse": {
        "properties": {
          "emailAddress": {
            "description": "Pipedream-generated email for email triggers",
            "type": "string"
          },
          "paymentLinkUrl": {
            "description": "AnySpend payment link URL",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateAutoSwapSettingsParams": {
        "properties": {
          "enabled": {
            "description": "Enabled turns the feature on or off for the org.",
            "type": "boolean"
          },
          "maxSwapAmountUsd": {
            "description": "MaxSwapAmountUsd caps each individual swap's output USD value. 0 = no limit.",
            "type": "number"
          },
          "mode": {
            "description": "Mode controls how sources are selected. Valid values: \"manual\",\n\"auto_highest_balance\", \"auto_lowest_balance\". Defaults to \"auto_lowest_balance\".",
            "type": "string"
          },
          "sources": {
            "description": "Sources is the ordered list of token sources to try when a balance top-up is needed.",
            "items": {
              "$ref": "#/components/schemas/AutoSwapSourceParams"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "UpdateCUThresholdSuccessResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/CUUpdateThresholdResult"
          },
          "message": {
            "example": "successfully",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateCaddieMemoryOrgSettingsParams": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": ["enabled"],
        "type": "object"
      },
      "UpdateCaddieMemoryOrgSettingsResponse": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdateCaddieMemoryOrgSettingsSuccessResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/UpdateCaddieMemoryOrgSettingsResponse"
          }
        },
        "type": "object"
      },
      "UpdateCaddieMemoryParams": {
        "properties": {
          "text": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": ["text"],
        "type": "object"
      },
      "UpdateCaddieMemorySettingsParams": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": ["enabled"],
        "type": "object"
      },
      "UpdateCaddieMemorySettingsResponse": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdateCaddieMemorySettingsSuccessResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/UpdateCaddieMemorySettingsResponse"
          }
        },
        "type": "object"
      },
      "UpdateConnectorParams": {
        "properties": {
          "data": {
            "additionalProperties": {},
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateConnectorSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Connector"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateDeepAgentsParams": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "enabledAgents": {
            "items": {
              "type": "string"
            },
            "maxItems": 32,
            "type": "array",
            "uniqueItems": false
          },
          "enabledPlatforms": {
            "description": "EnabledPlatforms is the chat-platform opt-in (web is implicit). Bounded to\nthe known platform surfaces so a typo can't silently persist as a platform\nthat never matches. Optional (nil = keep web-only) so pre-existing callers\nthat only know the two original fields stay valid PUTs.",
            "items": {
              "type": "string"
            },
            "maxItems": 8,
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["enabled", "enabledAgents"],
        "type": "object"
      },
      "UpdateDeepAgentsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/DeepAgentsResponse"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateFundAutoSwapParams": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "maxSwapAmountUsd": {
            "type": "number"
          },
          "mode": {
            "type": "string"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/OrgAutoSwapSource"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "UpdateFundAutoSwapSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowFundAutoSwapConfig"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSeoPageParams": {
        "properties": {
          "faqs": {
            "items": {
              "$ref": "#/components/schemas/SeoFAQ"
            },
            "type": "array",
            "uniqueItems": false
          },
          "heroDescription": {
            "type": "string"
          },
          "isPublished": {
            "type": "boolean"
          },
          "keywords": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "metaDescription": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "useCases": {
            "items": {
              "$ref": "#/components/schemas/SeoUseCase"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "UpdateSeoPageSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/SeoIntegrationPage"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateServiceAccountParams": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": ["name", "permissions"],
        "type": "object"
      },
      "UpdateVisibilityData": {
        "properties": {
          "id": {
            "type": "string"
          },
          "visibility": {
            "$ref": "#/components/schemas/WorkflowVisibility"
          }
        },
        "type": "object"
      },
      "UpdateVisibilityParams": {
        "properties": {
          "visibility": {
            "$ref": "#/components/schemas/WorkflowVisibility"
          }
        },
        "required": ["visibility"],
        "type": "object"
      },
      "UpdateVisibilitySuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/UpdateVisibilityData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateWorkflowParams": {
        "properties": {
          "cooldownMs": {
            "minimum": 1000,
            "type": "integer"
          },
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "description": {
            "maxLength": 2000,
            "type": "string"
          },
          "expectedCurrentVersion": {
            "minimum": 1,
            "type": "integer"
          },
          "maxRuns": {
            "maximum": 99999,
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "skipAIGeneration": {
            "description": "SkipAIGeneration is accepted for backward compatibility but ignored:\nthe server decides AI regeneration from the node-graph diff, not a hint.",
            "type": "boolean"
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          }
        },
        "type": "object"
      },
      "UpdateWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/Workflow"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateWorkflowUIMetadataParams": {
        "properties": {
          "expectedCurrentVersion": {
            "minimum": 1,
            "type": "integer"
          },
          "uiMetadata": {
            "$ref": "#/components/schemas/WorkflowUIMetadata"
          }
        },
        "required": ["uiMetadata"],
        "type": "object"
      },
      "UpdateWorkflowUIMetadataResponseData": {
        "properties": {
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "UpdateWorkflowUIMetadataSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/UpdateWorkflowUIMetadataResponseData"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpgradeStripeSubscriptionParams": {
        "properties": {
          "interval": {
            "type": "string"
          },
          "newTier": {
            "type": "string"
          }
        },
        "required": ["newTier"],
        "type": "object"
      },
      "UpgradeStripeSubscriptionResponse": {
        "properties": {
          "interval": {
            "type": "string"
          },
          "newTier": {
            "type": "string"
          },
          "oldTier": {
            "type": "string"
          },
          "subscriptionId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpsertWorkflowVariableDefParams": {
        "properties": {
          "default": {},
          "description": {
            "type": "string"
          },
          "lifetime": {
            "$ref": "#/components/schemas/VariableLifetime"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/VariableType"
          }
        },
        "required": ["lifetime", "type"],
        "type": "object"
      },
      "UsageTimeSeriesData": {
        "properties": {
          "data": {
            "description": "Time-series data points",
            "items": {
              "$ref": "#/components/schemas/UsageTimeSeriesPoint"
            },
            "type": "array",
            "uniqueItems": false
          },
          "granularity": {
            "description": "\"hourly\" or \"daily\"",
            "type": "string"
          },
          "nodeId": {
            "description": "e.g., \"send-erc20-token\"",
            "type": "string"
          },
          "nodeType": {
            "description": "\"action\" or \"trigger\"",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UserInterest": {
        "properties": {
          "kind": {
            "description": "app | tag | interest (display badge)",
            "example": "interest",
            "type": "string"
          },
          "lastSeen": {
            "description": "last reinforced",
            "type": "string"
          },
          "source": {
            "description": "conversation, manual, behavior, …",
            "example": "conversation",
            "type": "string"
          },
          "strength": {
            "description": "0-1 decayed effective score",
            "example": 0.82,
            "type": "number"
          },
          "tagId": {
            "description": "stable id, used to delete",
            "example": "interest_ab12cd34ef56",
            "type": "string"
          },
          "value": {
            "description": "the interest itself",
            "example": "NVDA",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UserInterestActionSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UserInterestSettings": {
        "properties": {
          "enabled": {
            "description": "per-user, default off",
            "example": false,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UserInterestSettingsSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/UserInterestSettings"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "req_abc123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ValidateWorkflowParams": {
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/WorkflowDefinition"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["definition"],
        "type": "object"
      },
      "ValidateWorkflowSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/ValidationResult"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ValidationErrorItem": {
        "properties": {
          "code": {
            "description": "Optional stable machine code for consumers to branch on (e.g. pure_variable_type_mismatch)",
            "type": "string"
          },
          "field": {
            "description": "Optional field name",
            "type": "string"
          },
          "message": {
            "description": "Human readable error message",
            "type": "string"
          },
          "nodeId": {
            "description": "Optional node ID",
            "type": "string"
          },
          "nodeName": {
            "description": "Optional node display name",
            "type": "string"
          },
          "type": {
            "description": "name, nodes, root, connectivity, pattern, variable",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ValidationResult": {
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ValidationErrorItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "valid": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "VerifyContractParams": {
        "properties": {
          "chainId": {
            "type": "integer"
          },
          "contractAddress": {
            "description": "Optional - uses address from deployment if not provided",
            "type": "string"
          }
        },
        "required": ["chainId"],
        "type": "object"
      },
      "VerifyContractResponse": {
        "properties": {
          "contractAddress": {
            "type": "string"
          },
          "explorerUrl": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "status": {
            "example": "verified",
            "type": "string"
          }
        },
        "type": "object"
      },
      "VerifySMSNumberRequest": {
        "properties": {
          "code": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          }
        },
        "required": ["code", "phoneNumber"],
        "type": "object"
      },
      "VerifySMSNumberSuccessResponse": {
        "properties": {
          "number": {
            "$ref": "#/components/schemas/SMSVerifiedNumber"
          }
        },
        "type": "object"
      },
      "VerifyX402EndpointParams": {
        "properties": {
          "bodyParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "exampleBody": {},
          "exampleOutput": {},
          "exampleQueryParams": {
            "additionalProperties": {},
            "description": "Examples",
            "type": "object"
          },
          "headerParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "type": "object"
          },
          "outputSchema": {
            "additionalProperties": {},
            "description": "Output schema",
            "type": "object"
          },
          "queryParams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ParamDefinition"
            },
            "description": "Input configuration (CDP-aligned flat structure)",
            "type": "object"
          }
        },
        "type": "object"
      },
      "VerifyX402EndpointSuccessResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/X402Endpoint"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WalletAccountParams": {
        "properties": {
          "addressFormat": {
            "enum": ["ADDRESS_FORMAT_ETHEREUM", "ADDRESS_FORMAT_SOLANA"],
            "type": "string"
          },
          "curve": {
            "enum": ["CURVE_SECP256K1", "CURVE_ED25519"],
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "pathFormat": {
            "enum": ["PATH_FORMAT_BIP32"],
            "type": "string"
          }
        },
        "required": ["addressFormat", "curve", "path", "pathFormat"],
        "type": "object"
      },
      "WalletResponse": {
        "properties": {
          "accountType": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "isImported": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "providerType": {
            "type": "string"
          },
          "providerWalletId": {
            "type": "string"
          },
          "turnkeyRootUserId": {
            "description": "TurnkeyRootUserId is an internal Turnkey infrastructure ID.\nOnly populated for the import-wallet flow; do not rely on it in other consumers.",
            "type": "string"
          },
          "turnkeySubOrgId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WithdrawWalletParams": {
        "properties": {
          "amount": {
            "type": "string"
          },
          "chainId": {
            "minimum": 1,
            "type": "integer"
          },
          "recipientAddress": {
            "type": "string"
          },
          "tokenAddress": {
            "type": "string"
          }
        },
        "required": ["amount", "chainId", "recipientAddress", "tokenAddress"],
        "type": "object"
      },
      "WithdrawWalletResponse": {
        "properties": {
          "blockNumber": {
            "type": "integer"
          },
          "transactionHash": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowConnectorInfo": {
        "properties": {
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowCountsResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowStatusCounts"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowIncomingLinks": {
        "properties": {
          "ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "WorkflowIncomingLinksResponse": {
        "properties": {
          "code": {
            "example": 200,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowIncomingLinks"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowListItem": {
        "properties": {
          "chainIds": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "connectors": {
            "items": {
              "$ref": "#/components/schemas/WorkflowConnectorInfo"
            },
            "type": "array",
            "uniqueItems": false
          },
          "cooldownMs": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "definitionSummary": {
            "$ref": "#/components/schemas/DefinitionSummary"
          },
          "description": {
            "type": "string"
          },
          "hasDraft": {
            "type": "boolean"
          },
          "hasLiveVersion": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "inputCount": {
            "description": "Count of definition.inputSchema entries — powers the \"N inputs\"\nbadge in WorkflowSelector without a detail fetch.",
            "type": "integer"
          },
          "lastTriggeredAt": {
            "type": "string"
          },
          "linkedWorkflowIds": {
            "description": "IDs referenced by any trigger-workflow node — lets useLinkedWorkflows\nbuild the incoming/outgoing link graph from the slim list.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "liveVersionPaused": {
            "type": "boolean"
          },
          "maxRuns": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "nodeCount": {
            "type": "integer"
          },
          "organizationId": {
            "type": "string"
          },
          "ownerUserId": {
            "type": "string"
          },
          "publicWidgetEnabled": {
            "type": "boolean"
          },
          "remainRuns": {
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "triggerName": {
            "type": "string"
          },
          "triggerType": {
            "description": "Pre-extracted fields (avoid FE parsing full definition).",
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/WorkflowType"
          },
          "updatedAt": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "visibility": {
            "$ref": "#/components/schemas/WorkflowVisibility"
          }
        },
        "type": "object"
      },
      "WorkflowMetaItem": {
        "properties": {
          "hasDraft": {
            "type": "boolean"
          },
          "hasLiveVersion": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "nodeTypes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "triggerName": {
            "type": "string"
          },
          "triggerType": {
            "description": "Trigger/action identity for the editor tab strip's icon + smart label.\nSourced from the precomputed list_metadata column (no definition parse),\nso a background tab — which has no loaded definition — can still render a\nmeaningful icon and \"<trigger> → <action>\" label instead of a date name.\nNodeTypes is the flat list of every node type (trigger + actions); the\nclient picks the primary action from it using its own type classification.",
            "type": "string"
          },
          "triggerTypes": {
            "description": "TriggerTypes lists the type of EVERY trigger (root) node. For\nsingle-trigger workflows this is a one-element slice matching\nTriggerType. For forest (multi-trigger) workflows it carries all\ntrigger types so the tab strip can show \"2 triggers → Swap\" instead\nof silently representing only the first trigger.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowOwnerCounts": {
        "properties": {
          "all": {
            "description": "All is every non-archived workflow the caller may see. A superset of\nthe other three, not their sum — they overlap and, critically, they\nmiss third-party-owned private workflows (visible to org owners only).",
            "type": "integer"
          },
          "org": {
            "type": "integer"
          },
          "public": {
            "type": "integer"
          },
          "yours": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WorkflowOwnerCountsResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowOwnerCounts"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowRunCount": {
        "properties": {
          "failure": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          },
          "running": {
            "type": "integer"
          },
          "success": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "waiting": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WorkflowRunCountByWorkflow": {
        "properties": {
          "failure": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          },
          "running": {
            "type": "integer"
          },
          "success": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "waiting": {
            "type": "integer"
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowStatsSummary": {
        "properties": {
          "counts": {
            "$ref": "#/components/schemas/WorkflowRunCount"
          },
          "recentRuns": {
            "items": {
              "$ref": "#/components/schemas/RecentRunItem"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "WorkflowStatusCounts": {
        "properties": {
          "active": {
            "type": "integer"
          },
          "archived": {
            "type": "integer"
          },
          "availableConnectors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "availableTypes": {
            "description": "AvailableTypes / AvailableConnectors are the distinct trigger-type and\nconnector-type values that exist in the org's workflows under the\ncurrent filter context (ignoring status — same scope as the counts\nabove). Frontend uses these to populate the filter-panel dropdowns so\nusers can pick from every option in the full result set, not just the\ncurrent visible page.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "draft": {
            "type": "integer"
          },
          "paused": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WorkflowTriggerAggregate": {
        "properties": {
          "cancelledCount": {
            "type": "integer"
          },
          "failureCount": {
            "type": "integer"
          },
          "lastFiredAt": {
            "type": "string"
          },
          "nextFireAt": {
            "type": "string"
          },
          "runCount": {
            "type": "integer"
          },
          "successCount": {
            "type": "integer"
          },
          "triggerNodeId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowTriggerAggregates": {
        "properties": {
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/WorkflowTriggerAggregate"
            },
            "type": "array",
            "uniqueItems": false
          },
          "workflowId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowTriggerAggregatesResponse": {
        "properties": {
          "code": {
            "example": 0,
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowTriggerAggregates"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "requestId": {
            "example": "abc-123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowVersionCount": {
        "properties": {
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WorkflowVersionsData": {
        "properties": {
          "currentVersion": {
            "type": "integer"
          },
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Workflow"
            },
            "type": "array",
            "uniqueItems": false
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "description": "JWT or API key, sent as: Bearer <token>",
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Workflow management API for B3OS",
    "title": "B3OS Workflow API",
    "version": "1.0"
  },
  "paths": {
    "/organizations/{orgId}/webhook-secret": {
      "get": {
        "description": "Get the organization's webhook secret for triggering workflows via integration webhooks",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "tags": ["organizations"]
      }
    },
    "/v1/action-proxy/{type}/execute": {
      "post": {
        "description": "Execute an action (write, charges CU)",
        "parameters": [
          {
            "description": "Action type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ActionProxyParams",
                    "summary": "body",
                    "description": "Proxy parameters"
                  }
                ]
              }
            }
          },
          "description": "Proxy parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionProxySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "tags": ["Action"]
      }
    },
    "/v1/action-proxy/{type}/query": {
      "post": {
        "description": "Query an action (read-only, no CU charge)",
        "parameters": [
          {
            "description": "Action type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ActionProxyQueryParams",
                    "summary": "body",
                    "description": "Proxy parameters"
                  }
                ]
              }
            }
          },
          "description": "Proxy parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionProxySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "tags": ["Action"]
      }
    },
    "/v1/actions": {
      "get": {
        "description": "List all available actions, optionally filtered by tags",
        "parameters": [
          {
            "description": "Filter by tags (comma-separated or multiple params). Actions must have ALL specified tags (AND logic).",
            "in": "query",
            "name": "tags",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListActionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": ["actions"]
      }
    },
    "/v1/actions/{type}": {
      "get": {
        "description": "Get an action definition by type",
        "parameters": [
          {
            "description": "Action type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetActionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/actions/{type}/run": {
      "post": {
        "description": "Execute a single action immediately (no workflow definition required)",
        "parameters": [
          {
            "description": "Action type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RunActionParams",
                    "summary": "body",
                    "description": "Run parameters"
                  }
                ]
              }
            }
          },
          "description": "Run parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunActionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "tags": ["Action"]
      }
    },
    "/v1/actions/{type}/test": {
      "post": {
        "description": "Test an action with custom payload",
        "parameters": [
          {
            "description": "Action type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/TestActionParams",
                    "summary": "body",
                    "description": "Test parameters"
                  }
                ]
              }
            }
          },
          "description": "Test parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestActionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "tags": ["Action"]
      }
    },
    "/v1/activity/stream": {
      "get": {
        "description": "SSE endpoint for real-time org-wide action notifications.",
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with activity events"
          }
        },
        "summary": "Stream org activity events",
        "tags": ["activity"]
      }
    },
    "/v1/agent-runs": {
      "post": {
        "description": "Spawns a first-party containerized agent (e.g. the workflow-builder\ndeep-agent) on the runtime worker. The org + user are taken from the\nauthenticated request; the server mints the worker session.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/StartAgentRunParams",
                    "summary": "body",
                    "description": "Agent run request"
                  }
                ]
              }
            }
          },
          "description": "Agent run request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartAgentRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Start an agent run",
        "tags": ["agent-runs"]
      }
    },
    "/v1/agent-runs/agents": {
      "get": {
        "description": "Returns the enabled first-party agents the deep-agent runtime can\nrun. Each item's `agentType` is the value to pass as\nStartAgentRunParams.agentType. Use this to discover what's\navailable before starting a run.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentTypesSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List available agent types",
        "tags": ["agent-runs"]
      }
    },
    "/v1/agent-runs/artifacts": {
      "get": {
        "description": "Returns the durable list of served web-app artifacts built by\ncompleted app-builder runs in the given Caddie conversation. The\norganization is taken from the authenticated request; the\nconversation is scoped to it. Each item carries the run id and the\nabsolute, browser-openable served URL.",
        "parameters": [
          {
            "description": "Conversation ID",
            "in": "query",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items to return (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items to skip (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentArtifactsSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List a conversation's app artifacts",
        "tags": ["agent-runs"]
      }
    },
    "/v1/agent-runs/history": {
      "get": {
        "description": "Returns the org-scoped run history for one deep agent (by\n`agentType`) — the audit trail of what was run: prompt, status,\nturns, token usage, cost, and a link to the served report when one\nwas produced. Newest-first.",
        "parameters": [
          {
            "description": "Agent type (registry key or custom agent id)",
            "in": "query",
            "name": "agentType",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items to return (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items to skip (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentRunHistorySuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List a deep agent's run history",
        "tags": ["agent-runs"]
      }
    },
    "/v1/agent-runs/latest-app-build": {
      "get": {
        "description": "Most recent served app build for a workflow; build is null when none exists yet.",
        "parameters": [
          {
            "description": "Workflow id",
            "in": "query",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatestAppBuildSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Latest served app build for a workflow",
        "tags": ["agent-runs"]
      }
    },
    "/v1/agent-runs/{id}": {
      "get": {
        "description": "Returns the run's status plus the append-only event log rows after\nthe `since` sequence number. Poll this to stream a run's progress.",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return events with seq greater than this (default 0)",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAgentRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get an agent run",
        "tags": ["agent-runs"]
      }
    },
    "/v1/agent-runs/{id}/cancel": {
      "post": {
        "description": "Requests cancellation of a running agent run. Cancellation is\nasynchronous — poll GET /v1/agent-runs/{id} to observe the\nterminal \"cancelled\" phase.",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelAgentRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Cancel an agent run",
        "tags": ["agent-runs"]
      }
    },
    "/v1/ai/pulse": {
      "get": {
        "description": "Get the proactive Pulse feed (situation-monitor cards + held-asset signals) for the caller's org.",
        "parameters": [
          {
            "description": "Pass \\",
            "in": "query",
            "name": "refresh",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pass \\",
            "in": "query",
            "name": "demo",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/debug": {
      "get": {
        "description": "Get debug data for an AI chat session",
        "parameters": [
          {
            "description": "Conversation ID (preferred, stable identifier)",
            "in": "query",
            "name": "conversationId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Workflow ID (for edit page, legacy)",
            "in": "query",
            "name": "workflowId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Session ID (for create page, legacy)",
            "in": "query",
            "name": "sessionId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Caddie lane to restrict to (v1, v2, v3). When omitted and grouped=false: non-admin callers default to v2 (backward compat); admin callers get the most recently updated lane, so v3-only conversations stay visible.",
            "in": "query",
            "name": "agentVersion",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "When true, return both v2 and v3 lanes as { versions: { v2, v3 } }",
            "in": "query",
            "name": "grouped",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatDebugDataSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "put": {
        "description": "Save or update debug data for an AI chat session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SaveChatDebugDataParams",
                    "summary": "body",
                    "description": "Debug data to save"
                  }
                ]
              }
            }
          },
          "description": "Debug data to save",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/history": {
      "get": {
        "description": "Get chat history for a conversation, workflow, or session",
        "parameters": [
          {
            "description": "Conversation ID (stable; preferred, used by V3 chat)",
            "in": "query",
            "name": "conversationId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Workflow ID (for edit page)",
            "in": "query",
            "name": "workflowId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Session ID (for create page)",
            "in": "query",
            "name": "sessionId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of messages to return (default: 20, max: 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "RFC3339 keyset cursor; return only messages strictly older than this createdAt (reverse pagination)",
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Keyset cursor tiebreak; the oldest loaded row's id, paired with before, so a tied createdAt at a page boundary is not skipped",
            "in": "query",
            "name": "beforeId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatHistorySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/messages": {
      "post": {
        "description": "Persist one chat message (caddie records V3 turns in chat history)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SaveChatMessageParams",
                    "summary": "body",
                    "description": "Message to persist"
                  }
                ]
              }
            }
          },
          "description": "Message to persist",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/preflight": {
      "get": {
        "description": "Check whether the org may start a caddie V3 chat turn (AI-Credit gate)",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreflightChatResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/sessions": {
      "get": {
        "description": "List chat sessions for the current organization",
        "parameters": [
          {
            "description": "Maximum number of sessions to return (default: 20, max: 50)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default: 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListChatSessionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/snapshot": {
      "get": {
        "description": "Get the live/pending state of a conversation (refresh-resume): whether a turn is actively running, the pending interrupt card, and the current mode. Excludes the transcript (use /chat/history) and the canvas (use the workflow record).",
        "parameters": [
          {
            "description": "Conversation ID (stable; the V3 chat checkpoint key)",
            "in": "query",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetConversationSnapshotSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/stream": {
      "post": {
        "description": "Issue a caddie-v3 chat session (Socket.IO). Returns sessionToken + socketUrl.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ChatParams",
                    "summary": "request",
                    "description": "Chat request parameters"
                  }
                ]
              }
            }
          },
          "description": "Chat request parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                }
              }
            },
            "description": "sessionToken + socketUrl for the caddie-v3 Socket.IO connection"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/ai/workflow/chat/usage": {
      "post": {
        "description": "Report one chat turn's LLM usage (caddie V3) for AI-Credit billing",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ReportChatUsageParams",
                    "summary": "body",
                    "description": "Turn usage to bill"
                  }
                ]
              }
            }
          },
          "description": "Turn usage to bill",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/api-keys": {
      "get": {
        "description": "List all API keys for the current organization",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAPIKeysSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "post": {
        "description": "Create a new API key for the current organization",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateAPIKeyParams",
                    "summary": "request",
                    "description": "API key details"
                  }
                ]
              }
            }
          },
          "description": "API key details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAPIKeySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/api-keys/requests": {
      "get": {
        "description": "List recent API request audit logs for the current organization",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by service account ID",
            "in": "query",
            "name": "serviceAccountId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by API key ID",
            "in": "query",
            "name": "apiKeyId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAPIRequestAuditsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "description": "Revoke an API key by ID",
        "parameters": [
          {
            "description": "API key ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeAPIKeySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "get": {
        "description": "Get a single API key by ID",
        "parameters": [
          {
            "description": "API key ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAPIKeySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/app-gateway/{appId}/runs/{runId}": {
      "get": {
        "description": "Get a single run's status and inputs/outputs",
        "parameters": [
          {
            "description": "Deep-agent run id (app id)",
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Run id",
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppGatewayRunDetailData"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/app-gateway/{appId}/runs/{runId}/resume": {
      "post": {
        "description": "Resume a deep-agent app run's waiting node",
        "parameters": [
          {
            "description": "Deep-agent run id (app id)",
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Run id",
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppGatewayResumeData"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/app-gateway/{appId}/session": {
      "post": {
        "description": "Mints a per-user app token for the signed-in viewer opening a login-required deep-agent artifact. Authed as the b3 user; the viewer's id + active org come from the auth context, not the body. The server resolves the artifact's org from the :appId (deep-agent run id), verifies the workflow is in it and the viewer is acting within it, then signs a token carrying the viewer's id.",
        "parameters": [
          {
            "description": "Deep-agent run id (app id)",
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/AppGatewayMintViewerTokenParams",
                    "summary": "body",
                    "description": "Viewer token mint params"
                  }
                ]
              }
            }
          },
          "description": "Viewer token mint params",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppGatewayMintTokenResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Mint a per-user app session token for a login-required deep-agent artifact",
        "tags": ["app-gateway"]
      }
    },
    "/v1/app-gateway/{appId}/workflows/{workflowId}/run": {
      "post": {
        "description": "Trigger a run for a deep-agent app's workflow",
        "parameters": [
          {
            "description": "Deep-agent run id (app id)",
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Workflow id",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppGatewayRunData"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/app-gateway/{appId}/workflows/{workflowId}/runs": {
      "get": {
        "description": "List runs for a deep-agent app's workflow",
        "parameters": [
          {
            "description": "Deep-agent run id (app id)",
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Workflow id",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppGatewayRunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/block-cursors": {
      "get": {
        "description": "Get latest block cursor for a chain",
        "parameters": [
          {
            "description": "Chain ID",
            "in": "query",
            "name": "chainId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "evm-log or native-transfer",
            "in": "query",
            "name": "cursorType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_app_api_http_v1_blockcursor.BlockCursorResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/connector-types": {
      "get": {
        "description": "List all available connector types",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListConnectorTypesSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/connector-types/{type}": {
      "get": {
        "description": "Get a connector type definition by type",
        "parameters": [
          {
            "description": "Connector type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetConnectorTypeSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/connectors": {
      "get": {
        "description": "List all connectors for the current user",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListConnectorsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "post": {
        "description": "Create a new connector",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateConnectorParams",
                    "summary": "request",
                    "description": "Connector details"
                  }
                ]
              }
            }
          },
          "description": "Connector details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateConnectorSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/connectors/{id}": {
      "delete": {
        "description": "Delete a connector",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteConnectorSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "get": {
        "description": "Get a connector by ID",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetConnectorSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "put": {
        "description": "Update a connector",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateConnectorParams",
                    "summary": "request",
                    "description": "Connector update details"
                  }
                ]
              }
            }
          },
          "description": "Connector update details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateConnectorSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/connectors/{id}/discord-server": {
      "get": {
        "description": "Get the Discord server installed for a connector",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDiscordConnectorServerSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/contract": {
      "post": {
        "description": "Create a new contract project",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_app_api_http_v1_contract.SaveProjectRequest",
                    "summary": "body",
                    "description": "Project data"
                  }
                ]
              }
            }
          },
          "description": "Project data",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contract/chat/stream": {
      "post": {
        "description": "Stream AI chat for smart contract development via SSE",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ContractChatParams",
                    "summary": "request",
                    "description": "Contract chat request parameters"
                  }
                ]
              }
            }
          },
          "description": "Contract chat request parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with contract events"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/contract/projects/{id}/stream": {
      "get": {
        "description": "SSE endpoint for real-time contract status updates (test results, audit, etc.)",
        "parameters": [
          {
            "description": "Contract Project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with contract events"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Stream contract project events",
        "tags": ["contracts"]
      }
    },
    "/v1/contract/session/{sessionId}": {
      "get": {
        "description": "Get a contract project by session ID",
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/contract/{id}": {
      "delete": {
        "description": "Delete a contract project by ID",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "get": {
        "description": "Get a contract project by ID",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "put": {
        "description": "Update a contract project",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_app_api_http_v1_contract.SaveProjectRequest",
                    "summary": "body",
                    "description": "Project data"
                  }
                ]
              }
            }
          },
          "description": "Project data",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contract/{id}/audit": {
      "post": {
        "description": "Run audit for a contract project",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contract/{id}/deploy/approve": {
      "post": {
        "description": "Approve and initiate contract deployment to testnet or mainnet",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveContractDeployParams",
                    "summary": "request",
                    "description": "Deployment parameters"
                  }
                ]
              }
            }
          },
          "description": "Deployment parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproveContractDeploySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/contract/{id}/download": {
      "get": {
        "description": "Download contract project as Foundry ZIP",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "type": "file"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contract/{id}/fix": {
      "post": {
        "description": "Trigger AI auto-fix for a contract with failed tests",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contract/{id}/plan/approve": {
      "post": {
        "description": "Approve a contract plan to proceed with code generation",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveContractPlanParams",
                    "summary": "request",
                    "description": "Plan approval"
                  }
                ]
              }
            }
          },
          "description": "Plan approval",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproveContractPlanSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/contract/{id}/test": {
      "post": {
        "description": "Run tests for a contract project",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContractProjectSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contract/{id}/verification-status": {
      "get": {
        "description": "Check verification status for all deployments of a contract project",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckVerificationStatusResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/contracts": {
      "get": {
        "description": "List contract projects for the organization",
        "parameters": [
          {
            "description": "Limit (default 20)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListContractProjectsSlimSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contracts/{id}/verify": {
      "post": {
        "description": "Verify a deployed contract's source code on block explorer (Etherscan, Basescan, etc.)",
        "parameters": [
          {
            "description": "Contract project ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/VerifyContractParams",
                    "summary": "request",
                    "description": "Verification parameters"
                  }
                ]
              }
            }
          },
          "description": "Verification parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyContractResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/cu/costs": {
      "get": {
        "description": "Get the complete CU cost list for all triggers and actions (public, no auth)",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCUCostsSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Get CU costs",
        "tags": ["CU"]
      }
    },
    "/v1/execution-webhooks": {
      "get": {
        "description": "List execution webhook endpoints for the current organization",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListExecutionWebhooksSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "post": {
        "description": "Create an org-level execution webhook endpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateExecutionWebhookParams",
                    "summary": "request",
                    "description": "Execution webhook details"
                  }
                ]
              }
            }
          },
          "description": "Execution webhook details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateExecutionWebhookSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/deliveries": {
      "get": {
        "description": "List execution webhook deliveries for the current organization",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by webhook endpoint ID",
            "in": "query",
            "name": "endpointId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListExecutionWebhookDeliveriesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/deliveries/{id}": {
      "get": {
        "description": "Get a single execution webhook delivery",
        "parameters": [
          {
            "description": "Webhook delivery ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/deliveries/{id}/replay": {
      "post": {
        "description": "Replay an execution webhook delivery by creating a new delivery record based on the original",
        "parameters": [
          {
            "description": "Webhook delivery ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayExecutionWebhookDeliverySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/deliveries/{id}/retry": {
      "post": {
        "description": "Retry a failed execution webhook delivery by requeueing the same delivery record",
        "parameters": [
          {
            "description": "Webhook delivery ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryExecutionWebhookDeliverySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/{id}": {
      "get": {
        "description": "Get a single execution webhook endpoint",
        "parameters": [
          {
            "description": "Webhook endpoint ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/{id}/disable": {
      "post": {
        "description": "Disable an execution webhook endpoint",
        "parameters": [
          {
            "description": "Webhook endpoint ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/{id}/enable": {
      "post": {
        "description": "Enable an execution webhook endpoint",
        "parameters": [
          {
            "description": "Webhook endpoint ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/execution-webhooks/{id}/regenerate-secret": {
      "post": {
        "description": "Regenerate the signing secret for an execution webhook endpoint",
        "parameters": [
          {
            "description": "Webhook endpoint ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/executions": {
      "get": {
        "description": "List executions for the current organization",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListExecutionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "post": {
        "description": "Create an execution for a workflow",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateExecutionParams",
                    "summary": "request",
                    "description": "Execution details"
                  }
                ]
              }
            }
          },
          "description": "Execution details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateExecutionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/executions/stats": {
      "get": {
        "description": "Get external execution stats for an organization",
        "parameters": [
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds)",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Granularity (hourly or daily)",
            "in": "query",
            "name": "granularity",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetExecutionStatsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/executions/stream": {
      "get": {
        "description": "SSE endpoint for real-time org-wide external execution updates.",
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with execution updates"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Stream org execution updates",
        "tags": ["executions"]
      }
    },
    "/v1/executions/{id}": {
      "get": {
        "description": "Get a single execution by ID",
        "parameters": [
          {
            "description": "Execution ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetExecutionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/executions/{id}/events": {
      "get": {
        "description": "Get events for an execution",
        "parameters": [
          {
            "description": "Execution ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetExecutionEventsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/executions/{id}/stream": {
      "get": {
        "description": "SSE endpoint for real-time external execution status updates.",
        "parameters": [
          {
            "description": "Execution ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with execution updates"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Stream execution updates",
        "tags": ["executions"]
      }
    },
    "/v1/faucet/claim": {
      "post": {
        "description": "Send testnet tokens from the faucet to the organization's default wallet",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ClaimFaucetParams",
                    "summary": "request",
                    "description": "Claim parameters"
                  }
                ]
              }
            }
          },
          "description": "Claim parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimFaucetResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "tags": ["faucet"]
      }
    },
    "/v1/incentive/state": {
      "get": {
        "description": "Returns all incentive task statuses + totals for caller's active org",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncentiveStateResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get incentive state",
        "tags": ["incentive"]
      }
    },
    "/v1/incentive/verify": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/IncentiveVerifyRequest",
                    "summary": "body",
                    "description": "Task to verify"
                  }
                ]
              }
            }
          },
          "description": "Task to verify",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncentiveVerifyResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Too Many Requests"
          }
        },
        "summary": "Verify and claim an incentive task",
        "tags": ["incentive"]
      }
    },
    "/v1/integrations/slack/events": {
      "post": {
        "description": "Handle Slack Events API webhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/integrations/slack/interactivity": {
      "post": {
        "description": "Handle Slack interaction webhook",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/integrations/slack/oauth-callback": {
      "get": {
        "description": "Handles Slack OAuth redirect",
        "parameters": [
          {
            "description": "Authorization code",
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "CSRF state token",
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Slack OAuth callback",
        "tags": ["integrations"]
      }
    },
    "/v1/integrations/slack/oauth-url": {
      "get": {
        "description": "Generates a Slack authorization URL",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Get Slack OAuth URL",
        "tags": ["integrations"]
      }
    },
    "/v1/integrations/telegram-b3os-bot": {
      "post": {
        "description": "Handle B3OS Telegram bot webhook update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "additionalProperties": {},
                    "title": "body",
                    "type": "object"
                  }
                ]
              }
            }
          },
          "description": "Telegram update payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/internal/anyspend/order-completed": {
      "post": {
        "description": "Handle AnySpend order-completed callback",
        "parameters": [
          {
            "description": "API key for authentication",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/AnySpendOrderCallbackParams",
                    "summary": "body",
                    "description": "AnySpend callback payload"
                  }
                ]
              }
            }
          },
          "description": "AnySpend callback payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnySpendOrderCallbackResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/internal/credits/deposit": {
      "post": {
        "description": "Handle credits deposit after payment",
        "parameters": [
          {
            "description": "API key for authentication",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreditsDepositParams",
                    "summary": "body",
                    "description": "Credits deposit payload"
                  }
                ]
              }
            }
          },
          "description": "Credits deposit payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsDepositResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/internal/subscription/cancel": {
      "post": {
        "description": "Cancel subscription and downgrade org (internal)",
        "parameters": [
          {
            "description": "API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/InternalSubscriptionCancelParams",
                    "summary": "body",
                    "description": "Cancel params"
                  }
                ]
              }
            }
          },
          "description": "Cancel params",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalSubscriptionCancelResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/invites": {
      "get": {
        "description": "List pending invites for the current user",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInvitesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/logic-actions": {
      "get": {
        "description": "List all available logic actions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListLogicActionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/mcp-connectors": {
      "get": {
        "description": "List all MCP connectors for the caller's org (token-free view)",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpListConnectorsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/mcp/servers": {
      "get": {
        "description": "List all known MCP servers (excluding the \"custom\" placeholder entry)",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServersCatalogSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/mcp/{serverId}/oauth-url": {
      "get": {
        "description": "Generate an OAuth authorization URL for the given MCP server",
        "parameters": [
          {
            "description": "MCP server ID",
            "in": "path",
            "name": "serverId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional connector display name",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpOAuthURLSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/metrics/failure-rate": {
      "get": {
        "description": "Get overall failure rate statistics for a time period. Maximum time range is 365 days.",
        "parameters": [
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds). Max 365 days from 'from'.",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetFailureRateSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/metrics/recent-activity": {
      "get": {
        "description": "Get recent workflow run activity",
        "parameters": [
          {
            "description": "Number of runs to return (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by status (success, failure, running)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRecentActivitySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/metrics/runs-timeseries": {
      "get": {
        "description": "Get time-series data for workflow runs (total, success, failure)",
        "parameters": [
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds)",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Granularity (hourly or daily)",
            "in": "query",
            "name": "granularity",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRunsTimeSeriesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/metrics/summary": {
      "get": {
        "description": "Get aggregated metrics (runs time-series, failure rate, top errors, recent activity) in a single request.",
        "parameters": [
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds)",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Granularity (hourly or daily)",
            "in": "query",
            "name": "granularity",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Top errors limit (default 10)",
            "in": "query",
            "name": "topErrorsLimit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Recent activity limit (default 50)",
            "in": "query",
            "name": "recentActivityLimit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter recent activity by status (success, failure, running)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMetricsSummarySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/metrics/top-errors": {
      "get": {
        "description": "Get most common errors with counts. Maximum time range is 365 days.",
        "parameters": [
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds). Max 365 days from 'from'.",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of errors to return (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTopErrorsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/onboarding/questions": {
      "get": {
        "description": "Get active onboarding questions for the specified scope",
        "parameters": [
          {
            "description": "Scope: 'user' or 'org'",
            "in": "query",
            "name": "scope",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOnboardingQuestionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["onboarding"]
      }
    },
    "/v1/onboarding/responses": {
      "post": {
        "description": "Submit onboarding responses and mark onboarding as complete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SubmitOnboardingResponsesParams",
                    "summary": "body",
                    "description": "Onboarding responses"
                  }
                ]
              }
            }
          },
          "description": "Onboarding responses",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitOnboardingResponsesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["onboarding"]
      }
    },
    "/v1/onboarding/status": {
      "get": {
        "description": "Get user's onboarding completion status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOnboardingStatusSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["onboarding"]
      }
    },
    "/v1/organizations": {
      "get": {
        "description": "List all organizations for the current user",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOrganizationsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/ai-credits/usage": {
      "get": {
        "description": "Get AI credit usage breakdown for a specific month",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Year-Month in YYYY-MM format",
            "in": "query",
            "name": "yearMonth",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAICreditUsageSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get AI credit usage",
        "tags": ["AI"]
      }
    },
    "/v1/organizations/{orgId}/auto-swap-settings": {
      "get": {
        "description": "Get automatic token swap settings for an organization. Returns a disabled default if not yet configured.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["organizations"]
      },
      "put": {
        "description": "Update automatic token swap settings for an organization. Owners only.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateAutoSwapSettingsParams",
                    "summary": "body",
                    "description": "Auto-swap settings"
                  }
                ]
              }
            }
          },
          "description": "Auto-swap settings",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["organizations"]
      }
    },
    "/v1/organizations/{orgId}/caddie-memory": {
      "delete": {
        "description": "Delete ALL memories Caddie holds about the calling user in this organization. The user's enable toggle is preserved.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClearCaddieMemorySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      },
      "get": {
        "description": "List a page of what Caddie remembers about the calling user in this organization (newest first), plus the user's memory enable toggle. Identity is taken from the authenticated session — a user can only see their own memories.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCaddieMemorySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/caddie-memory/org-settings": {
      "put": {
        "description": "Enable or disable Caddie's long-term memory for this organization (admin-only). Memory is disabled by default; while disabled, Caddie does not recall, learn, or store facts for any member of the org.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateCaddieMemoryOrgSettingsParams",
                    "summary": "request",
                    "description": "Toggle state"
                  }
                ]
              }
            }
          },
          "description": "Toggle state",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateCaddieMemoryOrgSettingsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/caddie-memory/settings": {
      "put": {
        "description": "Enable or disable Caddie's memory of the calling user in this organization. When disabled, Caddie stops recalling, learning, and storing facts about the user.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateCaddieMemorySettingsParams",
                    "summary": "request",
                    "description": "Toggle state"
                  }
                ]
              }
            }
          },
          "description": "Toggle state",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateCaddieMemorySettingsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/caddie-memory/{scope}/{key}": {
      "delete": {
        "description": "Delete one memory Caddie holds about the calling user in this organization.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Memory scope (profile or notes)",
            "in": "path",
            "name": "scope",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Memory key",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      },
      "put": {
        "description": "Edit the text of one memory Caddie holds about the calling user in this organization. Update-only — unknown keys return 404.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Memory scope (profile or notes)",
            "in": "path",
            "name": "scope",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Memory key",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateCaddieMemoryParams",
                    "summary": "request",
                    "description": "New memory text"
                  }
                ]
              }
            }
          },
          "description": "New memory text",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/cu": {
      "get": {
        "description": "Get current CU balance and minimum threshold for an organization",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCUBalanceSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get CU balance and threshold",
        "tags": ["CU"]
      }
    },
    "/v1/organizations/{orgId}/cu/runs": {
      "get": {
        "description": "Get recent workflow runs with their aggregated CU consumption",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination offset (default: 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCURunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get runs with CU costs",
        "tags": ["CU"]
      }
    },
    "/v1/organizations/{orgId}/cu/threshold": {
      "put": {
        "description": "Update the CU minimum balance threshold for an organization (admin only)",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateThresholdParams",
                    "summary": "body",
                    "description": "Threshold parameters"
                  }
                ]
              }
            }
          },
          "description": "Threshold parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateCUThresholdSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Update CU min threshold",
        "tags": ["CU"]
      }
    },
    "/v1/organizations/{orgId}/cu/usage": {
      "get": {
        "description": "Get CU usage breakdown for a specific month",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Year-Month in YYYY-MM format",
            "in": "query",
            "name": "yearMonth",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCUUsageSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get CU usage",
        "tags": ["CU"]
      }
    },
    "/v1/organizations/{orgId}/cu/usage-by-workflow": {
      "get": {
        "description": "Get per-workflow CU cost breakdown for a time period",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start time (unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End time (unix milliseconds)",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCUUsageByWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get CU usage by workflow",
        "tags": ["CU"]
      }
    },
    "/v1/organizations/{orgId}/database/query": {
      "post": {
        "description": "Execute SQL query against org's database",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ExecuteQueryParams",
                    "summary": "request",
                    "description": "SQL query and parameters"
                  }
                ]
              }
            }
          },
          "description": "SQL query and parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/database/tables": {
      "get": {
        "description": "List all tables in the org's database",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "tables": {
                      "items": {
                        "$ref": "#/components/schemas/TableInfo"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/database/tables/{tableName}": {
      "get": {
        "description": "Get table schema (columns) from the org's database",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Table name",
            "in": "path",
            "name": "tableName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "columns": {
                      "items": {
                        "$ref": "#/components/schemas/ColumnInfo"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/deep-agents": {
      "get": {
        "description": "Get the organization's deep-agent setting. `enabled` is the master switch — when false no agents run. `enabledAgents` is null when unrestricted (every agent).",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDeepAgentsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "put": {
        "description": "Set the organization's deep-agent setting. Saving makes it authoritative for the org, replacing the default.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateDeepAgentsParams",
                    "summary": "request",
                    "description": "Deep-agent setting"
                  }
                ]
              }
            }
          },
          "description": "Deep-agent setting",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDeepAgentsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/plan-options": {
      "get": {
        "description": "Returns all possible plan transitions with pre-calculated pricing",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPlanOptionsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/public": {
      "get": {
        "description": "Retrieve public metadata for an organization (no authentication required)\nThis endpoint is used for organization detail pages",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Organization public metadata"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Organization not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal server error"
          }
        },
        "summary": "Get public organization metadata",
        "tags": ["organizations"]
      }
    },
    "/v1/organizations/{orgId}/sessions": {
      "get": {
        "description": "List active wallet sessions with pagination",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSessionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["sessions"]
      },
      "post": {
        "description": "Create a new wallet session key",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateSessionParams",
                    "summary": "request",
                    "description": "Session parameters"
                  }
                ]
              }
            }
          },
          "description": "Session parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSessionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["sessions"]
      }
    },
    "/v1/organizations/{orgId}/sessions/{id}": {
      "delete": {
        "description": "Revoke a wallet session key",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeSessionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["sessions"]
      }
    },
    "/v1/organizations/{orgId}/stripe/billing-details": {
      "get": {
        "description": "Return Stripe payment methods and invoices for an organization",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetStripeBillingDetailsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/stripe/checkout-sessions": {
      "post": {
        "description": "Create a Stripe Checkout Session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCheckoutSessionParams",
                    "summary": "body",
                    "description": "Checkout session parameters"
                  }
                ]
              }
            }
          },
          "description": "Checkout session parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCheckoutSessionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/stripe/payment-methods/{pmId}": {
      "delete": {
        "description": "Detach a payment method from the organization's Stripe customer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/stripe/setup-intents": {
      "post": {
        "description": "Create a Stripe SetupIntent for collecting a new payment method",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSetupIntentResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/stripe/subscriptions/downgrade": {
      "post": {
        "description": "Downgrade a Stripe subscription (or cancel to free)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/DowngradeStripeSubscriptionParams",
                    "summary": "body",
                    "description": "Downgrade parameters"
                  }
                ]
              }
            }
          },
          "description": "Downgrade parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DowngradeStripeSubscriptionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/stripe/subscriptions/preview-upgrade": {
      "get": {
        "description": "Returns pro-rated amounts for all upgrade-eligible tier+interval combos",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewUpgradeResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Preview pro-rated upgrade pricing"
      }
    },
    "/v1/organizations/{orgId}/stripe/subscriptions/reactivate": {
      "post": {
        "description": "Reactivate a subscription with pending cancellation",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReactivateSubscriptionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/stripe/subscriptions/upgrade": {
      "post": {
        "description": "Upgrade a Stripe subscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpgradeStripeSubscriptionParams",
                    "summary": "body",
                    "description": "Upgrade parameters"
                  }
                ]
              }
            }
          },
          "description": "Upgrade parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeStripeSubscriptionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/organizations/{orgId}/templates/public": {
      "get": {
        "description": "Retrieve all public templates for a specific organization (no authentication required)\nThis endpoint is used for organization detail pages to showcase public templates",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Public templates for organization"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal server error"
          }
        },
        "summary": "List public templates by organization",
        "tags": ["workflow-templates"]
      }
    },
    "/v1/organizations/{orgId}/wallets": {
      "get": {
        "description": "List all wallets for an organization with pagination",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWalletsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      },
      "post": {
        "description": "Create a new Turnkey wallet for an organization",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateWalletParams",
                    "summary": "request",
                    "description": "Wallet name"
                  }
                ]
              }
            }
          },
          "description": "Wallet name",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      }
    },
    "/v1/organizations/{orgId}/wallets/import": {
      "post": {
        "description": "Register an imported Turnkey private key wallet for an organization",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ImportWalletParams",
                    "summary": "request",
                    "description": "Import wallet params"
                  }
                ]
              }
            }
          },
          "description": "Import wallet params",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      }
    },
    "/v1/organizations/{orgId}/wallets/polymarket-deposit": {
      "post": {
        "description": "Create a Polymarket deposit wallet for an organization",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupDepositWalletResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      }
    },
    "/v1/organizations/{orgId}/wallets/{walletId}": {
      "delete": {
        "description": "Archive a wallet (soft delete). Cannot archive default wallet or only wallet.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Wallet ID",
            "in": "path",
            "name": "walletId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveWalletResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      },
      "patch": {
        "description": "Rename an organization wallet's user-facing label. The wallet's\non-chain address and Turnkey identifiers are unchanged.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Wallet ID",
            "in": "path",
            "name": "walletId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RenameWalletParams",
                    "summary": "request",
                    "description": "Rename parameters"
                  }
                ]
              }
            }
          },
          "description": "Rename parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationWallet"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      }
    },
    "/v1/organizations/{orgId}/wallets/{walletId}/default": {
      "put": {
        "description": "Set a wallet as the default wallet for an organization.",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Wallet ID",
            "in": "path",
            "name": "walletId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationWallet"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["wallets"]
      }
    },
    "/v1/organizations/{orgId}/wallets/{walletId}/withdraw": {
      "post": {
        "description": "Withdraw tokens from an organization wallet via Turnkey signing",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Wallet ID",
            "in": "path",
            "name": "walletId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/WithdrawWalletParams",
                    "summary": "request",
                    "description": "Withdraw parameters"
                  }
                ]
              }
            }
          },
          "description": "Withdraw parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawWalletResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "tags": ["wallets"]
      }
    },
    "/v1/orgs/{orgId}/integrations/coinbase": {
      "post": {
        "description": "Handle Coinbase Business webhook event",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Coinbase signature header",
            "in": "header",
            "name": "X-Hook0-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/integrations/farcaster": {
      "post": {
        "description": "Handle Farcaster webhook trigger from Neynar",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/FarcasterWebhookPayload",
                    "summary": "body",
                    "description": "Neynar webhook event"
                  }
                ]
              }
            }
          },
          "description": "Neynar webhook event",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/integrations/pipedream": {
      "post": {
        "description": "Handle Pipedream trigger source webhook event",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Webhook secret",
            "in": "query",
            "name": "secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "additionalProperties": {},
                    "title": "body",
                    "type": "object"
                  }
                ]
              }
            }
          },
          "description": "Pipedream event payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/integrations/shopify": {
      "post": {
        "description": "Handle Shopify webhook event",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Webhook secret",
            "in": "query",
            "name": "secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Shopify topic (e.g., orders/create)",
            "in": "header",
            "name": "X-Shopify-Topic",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Shop domain (e.g., my-store.myshopify.com)",
            "in": "header",
            "name": "X-Shopify-Shop-Domain",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC signature for payload verification",
            "in": "header",
            "name": "X-Shopify-Hmac-SHA256",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "additionalProperties": {},
                    "title": "body",
                    "type": "object"
                  }
                ]
              }
            }
          },
          "description": "Shopify webhook payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/integrations/stripe": {
      "post": {
        "description": "Handle connector-based Stripe webhook event",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Webhook secret (optional)",
            "in": "query",
            "name": "secret",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Stripe signature header",
            "in": "header",
            "name": "Stripe-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/integrations/telegram": {
      "post": {
        "description": "Handle Telegram webhook update",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Webhook secret",
            "in": "query",
            "name": "secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "additionalProperties": {},
                    "title": "body",
                    "type": "object"
                  }
                ]
              }
            }
          },
          "description": "Telegram update payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/invites": {
      "get": {
        "description": "List pending invites for an organization",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOrgInvitesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/orgs/{orgId}/members": {
      "get": {
        "description": "List all members of an organization",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMembersSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/outbound-webhook/deliveries": {
      "get": {
        "description": "List outbound webhook deliveries with optional workflow filter and pagination",
        "parameters": [
          {
            "description": "Filter by workflow ID",
            "in": "query",
            "name": "workflowId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max results per page (1-100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "type": "integer"
            }
          },
          {
            "description": "Pagination offset",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOutboundWebhookDeliveriesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "List outbound webhook deliveries",
        "tags": ["Outbound Webhook"]
      }
    },
    "/v1/outbound-webhook/deliveries/{id}": {
      "get": {
        "description": "Get a single outbound webhook delivery by ID",
        "parameters": [
          {
            "description": "Delivery ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOutboundWebhookDeliverySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get outbound webhook delivery",
        "tags": ["Outbound Webhook"]
      }
    },
    "/v1/outbound-webhook/deliveries/{id}/replay": {
      "post": {
        "description": "Replay a webhook delivery by creating a new delivery based on the original. Unlike retry (which re-attempts a failed delivery), replay creates a NEW delivery record and can be used on any status.",
        "parameters": [
          {
            "description": "Original Delivery ID to replay",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayOutboundWebhookDeliverySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Replay outbound webhook delivery",
        "tags": ["Outbound Webhook"]
      }
    },
    "/v1/outbound-webhook/deliveries/{id}/retry": {
      "post": {
        "description": "Manually retry a failed outbound webhook delivery",
        "parameters": [
          {
            "description": "Delivery ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryOutboundWebhookDeliverySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Retry outbound webhook delivery",
        "tags": ["Outbound Webhook"]
      }
    },
    "/v1/pipedream/accounts/{id}": {
      "delete": {
        "description": "Disconnect a Pipedream account",
        "parameters": [
          {
            "description": "Account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletePipedreamAccountSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      },
      "get": {
        "description": "Get a Pipedream account by ID",
        "parameters": [
          {
            "description": "Account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPipedreamAccountSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/pipedream/apps": {
      "get": {
        "description": "List available Pipedream apps/integrations",
        "parameters": [
          {
            "description": "Search query to filter apps",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPipedreamAppsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/pipedream/apps/{app}/actions": {
      "get": {
        "description": "List available actions for a Pipedream app",
        "parameters": [
          {
            "description": "App slug (e.g., 'twilio', 'google_sheets')",
            "in": "path",
            "name": "app",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPipedreamActionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/pipedream/connect-token": {
      "get": {
        "description": "Get a Pipedream Connect token for the frontend SDK",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetConnectTokenSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/public/contact": {
      "post": {
        "description": "Submit the public contact form. Delivers an email to the\nconfigured recipient via the central B3 Notifications API. No\nauth; IP-rate-limited (see configs.contact.rate_limit_per_hour).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SubmitContactFormRequest",
                    "summary": "body",
                    "description": "Contact form payload"
                  }
                ]
              }
            }
          },
          "description": "Contact form payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitContactFormSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/public/executions/{id}": {
      "get": {
        "description": "Get the current status and event timeline for a public execution",
        "parameters": [
          {
            "description": "Execution ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Client token returned when the execution was created",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPublicExecutionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/public/executions/{id}/stream": {
      "get": {
        "description": "SSE endpoint for real-time public execution status updates using the client token returned at creation time.",
        "parameters": [
          {
            "description": "Execution ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Client token returned when the execution was created",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with execution updates"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "Stream public execution updates",
        "tags": ["executions"]
      }
    },
    "/v1/public/runs/by-tx/{txHash}": {
      "get": {
        "description": "Find a run by trigger transaction hash (no auth required)",
        "parameters": [
          {
            "description": "Transaction Hash",
            "in": "path",
            "name": "txHash",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPublicRunByTxSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/public/runs/{id}": {
      "get": {
        "description": "Get a public run by ID",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPublicRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/public/workflows/{id}": {
      "get": {
        "description": "Get a public workflow by visibility",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Workflow version",
            "in": "query",
            "name": "v",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPublicWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/public/workflows/{id}/executions": {
      "post": {
        "description": "Create a client-trackable execution session for a public_execute workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreatePublicExecutionParams",
                    "summary": "body",
                    "description": "Execution metadata"
                  }
                ]
              }
            }
          },
          "description": "Execution metadata",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateExecutionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Too Many Requests"
          }
        }
      }
    },
    "/v1/public/workflows/{id}/meta": {
      "get": {
        "description": "Get public metadata (name, description) for a workflow.\nNo auth required — intentionally unauthenticated for OG image generation.\nOnly returns title and description; no sensitive data is exposed.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPublicMetaSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/public/workflows/{id}/run": {
      "post": {
        "description": "Trigger a run for a public_execute workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "additionalProperties": {},
                    "title": "body",
                    "type": "object"
                  }
                ]
              }
            }
          },
          "description": "Trigger payload"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/public/workflows/{id}/runs": {
      "get": {
        "description": "List runs for a public workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPublicRunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/public/workflows/{id}/widget": {
      "get": {
        "description": "Get public widget configuration for a workflow (no auth required)",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPublicWidgetSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/realtime/session": {
      "post": {
        "description": "Mints a short-lived token for the workflow realtime Socket.IO endpoint. Connect with socket.io-client using `path: socketPath` and `auth: {token: sessionToken}`, then subscribe to topics (workflow-runs, run, activity, execution, contract). Returns 503 when the realtime transport is not enabled on the environment — fall back to the SSE stream endpoints.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {},
                  "type": "object"
                }
              }
            },
            "description": "sessionToken + socketPath + expiresInSeconds"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Create a realtime session",
        "tags": ["realtime"]
      }
    },
    "/v1/runs": {
      "get": {
        "description": "List all runs",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by run status (running, waiting, success, partial, failure, cancelled)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      },
      "post": {
        "description": "Execute an inline workflow definition (ephemeral run). The definition must use \"manual\" trigger type. No workflow is saved — the definition is executed once and the run is recorded with workflowId=\"\". Requires WorkflowCreate permission.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/EphemeralRunParams",
                    "summary": "body",
                    "description": "Inline workflow definition and optional payload/props"
                  }
                ]
              }
            }
          },
          "description": "Inline workflow definition and optional payload/props",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunSuccessResponse"
                }
              }
            },
            "description": "Run created and enqueued for execution"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid definition (400228), non-manual trigger (400229), invalid run ID (400078), or duplicate run ID (400079)"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Insufficient CU balance"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing org context or insufficient permissions"
          }
        }
      }
    },
    "/v1/runs/status-counts": {
      "get": {
        "description": "Count all runs in the caller's organization, grouped by status. Optional since (RFC3339) restricts to runs started at or after that instant.",
        "parameters": [
          {
            "description": "RFC3339 timestamp; only count runs with startedAt >= since",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountWorkflowRunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/runs/status-counts/by-workflow": {
      "get": {
        "description": "Count runs in the caller's organization grouped by workflow and status, sorted by total runs descending. Optional since (RFC3339) restricts to runs started at or after that instant.",
        "parameters": [
          {
            "description": "RFC3339 timestamp; only count runs with startedAt >= since",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountRunsByWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/runs/sync": {
      "post": {
        "description": "Execute a workflow definition synchronously. Blocks until all nodes\ncomplete and returns the full execution state. Max 60s timeout, 20 nodes.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SyncRunParams",
                    "summary": "body",
                    "description": "Workflow definition to execute"
                  }
                ]
              }
            }
          },
          "description": "Workflow definition to execute",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncRunResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payment Required"
          }
        },
        "tags": ["Run"]
      }
    },
    "/v1/runs/tx-attribution": {
      "post": {
        "description": "Resolve blockchain transaction hashes to the workflow run that executed them",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RunTransactionAttributionsRequest",
                    "summary": "body",
                    "description": "Transaction hashes"
                  }
                ]
              }
            }
          },
          "description": "Transaction hashes",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunTransactionAttributionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Batch run transaction attribution",
        "tags": ["runs"]
      }
    },
    "/v1/runs/{id}": {
      "get": {
        "description": "Get a specific run by ID",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Set to 'true' to omit ExecutionState and WorkflowDefinition for a lighter payload.",
            "in": "query",
            "name": "summary",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Comma-separated node IDs to include in ExecutionState (returns only those nodes).",
            "in": "query",
            "name": "nodeIds",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/runs/{id}/cancel": {
      "post": {
        "description": "Cancel a running or waiting run",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        }
      }
    },
    "/v1/runs/{id}/nodes/{nodeId}/resume": {
      "post": {
        "description": "Resume a waiting node in a workflow run",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Node ID",
            "in": "path",
            "name": "nodeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Per-workflow webhook secret",
            "in": "query",
            "name": "secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_app_api_http_v1_run.resumeBody",
                    "summary": "body",
                    "description": "Resume payload"
                  }
                ]
              }
            }
          },
          "description": "Resume payload"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResumeResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/runs/{id}/retry": {
      "post": {
        "description": "Retry a failed or cancelled run from its failure point",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRunSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        }
      }
    },
    "/v1/runs/{id}/stream": {
      "get": {
        "description": "SSE endpoint for real-time run status updates. Clients MUST subscribe BEFORE triggering the run to avoid missing the initial run_started event. Use pre-subscription with client-provided runId.",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with run events"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Stream run execution events",
        "tags": ["runs"]
      }
    },
    "/v1/runs/{runId}/variable-writes": {
      "get": {
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max rows per page",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRunVariableWritesResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Variable writes for a run",
        "tags": ["WorkflowVariables"]
      }
    },
    "/v1/search": {
      "get": {
        "description": "Hybrid search (keyword + semantic) across templates, actions, triggers, connector definitions, and workflows",
        "parameters": [
          {
            "description": "Search query",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Resource types to search: template, action, trigger, connector_def, workflow (singular or plural forms accepted)",
            "in": "query",
            "name": "types",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Results per type (default: 20, max: 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination offset (default: 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Search resources",
        "tags": ["Search"]
      }
    },
    "/v1/search/similar/{type}/{id}": {
      "get": {
        "description": "Find resources semantically similar to a given resource",
        "parameters": [
          {
            "description": "Resource type: action, template, trigger, connector_def (singular or plural forms accepted)",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Resource ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max results (default: 5, max: 20)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Find similar resources",
        "tags": ["Search"]
      }
    },
    "/v1/seo/pages": {
      "get": {
        "description": "List all published SEO integration pages with pagination",
        "parameters": [
          {
            "description": "Filter by page type: single or combo",
            "in": "query",
            "name": "page_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of pages (default: 100, max: 1000)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default: 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSeoPagesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["seo"]
      }
    },
    "/v1/seo/pages/bulk-upsert": {
      "post": {
        "description": "Bulk upsert SEO integration pages (used by CI/CD build script)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/BulkUpsertSeoPagesParams",
                    "summary": "body",
                    "description": "Pages to upsert"
                  }
                ]
              }
            }
          },
          "description": "Pages to upsert",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertSeoPagesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["seo"]
      }
    },
    "/v1/seo/pages/generate": {
      "post": {
        "description": "Trigger SEO page generation (admin only).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/GenerateSeoPagesParams",
                    "summary": "body",
                    "description": "Generation parameters"
                  }
                ]
              }
            }
          },
          "description": "Generation parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["seo"]
      }
    },
    "/v1/seo/pages/{slug}": {
      "get": {
        "description": "Get a single SEO integration page by slug",
        "parameters": [
          {
            "description": "Page slug (e.g. airtable or airtable-and-polymarket)",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSeoPageSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["seo"]
      },
      "put": {
        "description": "Update a SEO integration page by slug (admin only)",
        "parameters": [
          {
            "description": "Page slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateSeoPageParams",
                    "summary": "body",
                    "description": "Fields to update"
                  }
                ]
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSeoPageSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["seo"]
      }
    },
    "/v1/service-accounts": {
      "get": {
        "description": "List service accounts for the current organization",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListServiceAccountsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "post": {
        "description": "Create a service account for the current organization",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateServiceAccountParams",
                    "summary": "request",
                    "description": "Service account details"
                  }
                ]
              }
            }
          },
          "description": "Service account details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetServiceAccountSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/service-accounts/{id}": {
      "delete": {
        "description": "Permanently delete a service account. Any active API keys\nowned by the account are revoked before the account is removed.",
        "parameters": [
          {
            "description": "Service account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "get": {
        "description": "Get a single service account by ID",
        "parameters": [
          {
            "description": "Service account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetServiceAccountSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "patch": {
        "description": "Update a service account's name, description, and permissions",
        "parameters": [
          {
            "description": "Service account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateServiceAccountParams",
                    "summary": "request",
                    "description": "Service account updates"
                  }
                ]
              }
            }
          },
          "description": "Service account updates",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetServiceAccountSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/service-accounts/{id}/disable": {
      "post": {
        "description": "Disable a service account",
        "parameters": [
          {
            "description": "Service account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/service-accounts/{id}/enable": {
      "post": {
        "description": "Enable a service account",
        "parameters": [
          {
            "description": "Service account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/situation/universe": {
      "get": {
        "description": "Available tickers (and ticker search) covered by situation-monitor, for the Situation trigger's ticker filter",
        "parameters": [
          {
            "description": "Search query (ranked). When omitted, returns the rank-ordered listing.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter listing by asset class (equity | crypto | index)",
            "in": "query",
            "name": "asset_class",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset (default 0, listing only)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSituationUniverseSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "List / search the situation coverage universe"
      }
    },
    "/v1/sms/numbers": {
      "get": {
        "description": "List verified phone numbers for the organization",
        "parameters": [
          {
            "description": "Search query",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSMSNumbersSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "List verified phone numbers"
      }
    },
    "/v1/sms/numbers/initiate-verify": {
      "post": {
        "description": "Generates a verification code for the user to text to the B3OS phone number",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SMSInitiateVerifyRequest",
                    "summary": "body",
                    "description": "Phone number to verify"
                  }
                ]
              }
            }
          },
          "description": "Phone number to verify",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSInitiateVerifySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Too Many Requests"
          }
        },
        "summary": "Initiate phone number verification via outbound message"
      }
    },
    "/v1/sms/numbers/send-code": {
      "post": {
        "description": "Sends a one-time verification code via iMessage or SMS to the given phone number",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SMSSendCodeRequest",
                    "summary": "body",
                    "description": "Phone number to verify"
                  }
                ]
              }
            }
          },
          "description": "Phone number to verify",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSSendCodeSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Too Many Requests"
          }
        },
        "summary": "Send a verification code to a phone number"
      }
    },
    "/v1/sms/numbers/verify": {
      "post": {
        "description": "Validates the OTP code sent to the phone number and registers it for use",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/VerifySMSNumberRequest",
                    "summary": "body",
                    "description": "Phone number and verification code"
                  }
                ]
              }
            }
          },
          "description": "Phone number and verification code",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifySMSNumberSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Verify a phone number for iMessage/SMS messaging"
      }
    },
    "/v1/sms/numbers/verify-status": {
      "get": {
        "description": "Polls whether a phone number has been verified via inbound message",
        "parameters": [
          {
            "description": "Phone number in E.164 format",
            "in": "query",
            "name": "phoneNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSVerifyStatusSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Check phone number verification status"
      }
    },
    "/v1/sms/numbers/{id}": {
      "delete": {
        "description": "Removes a verified phone number from the organization",
        "parameters": [
          {
            "description": "Verified number ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Delete a verified phone number"
      }
    },
    "/v1/statistics": {
      "get": {
        "description": "Get cumulative statistics for all nodes (actions + triggers)",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAllStatisticsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/statistics/action/{id}/latency": {
      "get": {
        "description": "Get latency time-series data for a specific action",
        "parameters": [
          {
            "description": "Action ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds)",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Granularity (hourly or daily)",
            "in": "query",
            "name": "granularity",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetLatencyTimeSeriesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/statistics/{type}/{id}/usage": {
      "get": {
        "description": "Get usage time-series data for a specific node",
        "parameters": [
          {
            "description": "Node type (action or trigger)",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Node ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start timestamp (Unix milliseconds)",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "End timestamp (Unix milliseconds)",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Granularity (hourly or daily)",
            "in": "query",
            "name": "granularity",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsageTimeSeriesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/tags": {
      "get": {
        "description": "List available tags, optionally filtered by category and/or search query with pagination",
        "parameters": [
          {
            "description": "Filter by category (e.g., 'blockchain', 'finance', 'App')",
            "in": "query",
            "name": "category",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Full-text search query (searches name and description)",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of tags to return (default: 20, max: 1000)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of tags to skip for pagination (default: 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Sort by count (popularity) instead of weight (default: false). Count type depends on scope: templates for template scopes, actions for action scope, triggers for trigger scope",
            "in": "query",
            "name": "sortByCount",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Count scope: 'all' (default), 'templates_public', 'templates_promoted', 'templates_org', 'actions', 'triggers', 'connectors'",
            "in": "query",
            "name": "scope",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pagination bypass key to allow limit > 1000",
            "in": "query",
            "name": "pagination_bypass_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["tags"]
      }
    },
    "/v1/tags/categories": {
      "get": {
        "description": "List all unique categories from tags",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["tags"]
      }
    },
    "/v1/telegram-bot/chats": {
      "get": {
        "description": "List verified Telegram chats for organization",
        "parameters": [
          {
            "description": "Search query",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by connector ID",
            "in": "query",
            "name": "connector_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTelegramChatsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/telegram-bot/pins": {
      "post": {
        "description": "Generate a PIN for Telegram chat verification",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateTelegramPinSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/telegram-bot/pins/{pin}/status": {
      "get": {
        "description": "Check Telegram PIN verification status",
        "parameters": [
          {
            "description": "6-digit PIN",
            "in": "path",
            "name": "pin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckTelegramPinSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates": {
      "get": {
        "description": "List templates by category and tags",
        "parameters": [
          {
            "description": "Template category (promoted, public, org, all)",
            "in": "query",
            "name": "category",
            "schema": {
              "default": "all",
              "type": "string"
            }
          },
          {
            "description": "Tag slugs to filter by (can specify multiple)",
            "in": "query",
            "name": "tags",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      },
      "post": {
        "description": "Create a new workflow template",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateWorkflowTemplateRequest",
                    "summary": "request",
                    "description": "Template details"
                  }
                ]
              }
            }
          },
          "description": "Template details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/templates/by-source-workflow/{workflowId}": {
      "get": {
        "description": "Get template by source workflow ID. Returns 200 with null data when no template exists for the workflow.",
        "parameters": [
          {
            "description": "Source workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/templates/recommended": {
      "get": {
        "description": "Get personalized template recommendations based on user's tag interests",
        "parameters": [
          {
            "description": "Template category: 'promoted', 'public', 'org', 'all'",
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of templates to return (default: 20, max: 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Recommendation strategy: 'strong_match', 'interest_based' (default), 'popular_with_interest'",
            "in": "query",
            "name": "strategy",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecommendTemplatesSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["templates"]
      }
    },
    "/v1/templates/{id}": {
      "delete": {
        "description": "Delete a template (admin only)",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{id}/promote": {
      "put": {
        "description": "Promote a template (admin only)",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{id}/unpromote": {
      "put": {
        "description": "Unpromote a template (admin only)",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{templateId}": {
      "get": {
        "description": "Retrieve a template by ID with authorization (public templates or user's org templates)\nNo authentication required for public templates. Authenticated users can access their org's templates.",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Template details"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Template not found or unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal server error"
          }
        },
        "summary": "Get template by ID",
        "tags": ["workflow-templates"]
      },
      "patch": {
        "description": "Update an existing workflow template",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateWorkflowTemplateRequest",
                    "summary": "request",
                    "description": "Template update details"
                  }
                ]
              }
            }
          },
          "description": "Template update details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{templateId}/rollback": {
      "post": {
        "description": "Rollback template to a previous version",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RollbackTemplateParams",
                    "summary": "body",
                    "description": "Rollback params"
                  }
                ]
              }
            }
          },
          "description": "Rollback params",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackTemplateSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{templateId}/stats": {
      "get": {
        "description": "Retrieve aggregate statistics for a template (deploy counts, success rate, etc.)",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/data"
                    }
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Template statistics"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Template not found or unauthorized"
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Template archived"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal server error"
          }
        },
        "summary": "Get template statistics",
        "tags": ["workflow-templates"]
      }
    },
    "/v1/templates/{templateId}/versions": {
      "get": {
        "description": "List all versions of a template",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTemplateVersionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{templateId}/versions/count": {
      "get": {
        "description": "Count total versions for a specific template",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountTemplateVersionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/templates/{templateId}/versions/{versionNumber}": {
      "get": {
        "description": "Get a specific version of a template by version number",
        "parameters": [
          {
            "description": "Template ID",
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Version number",
            "in": "path",
            "name": "versionNumber",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTemplateVersionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/tiers": {
      "get": {
        "description": "List all subscription tiers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTiersResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/token-price-cexes/available-assets": {
      "get": {
        "description": "Get available assets for token price (CEXes)",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableAssetsTokenPriceCexesSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/token-price-cexes/latest": {
      "get": {
        "description": "Get latest prices for specified assets",
        "parameters": [
          {
            "description": "Comma-separated list of assets",
            "in": "query",
            "name": "assets",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatestPricesTokenPriceCexesSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/triggers": {
      "get": {
        "description": "List all available triggers, optionally filtered by tags",
        "parameters": [
          {
            "description": "Filter by tags (comma-separated or multiple params). Triggers must have ALL specified tags (AND logic).",
            "in": "query",
            "name": "tags",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTriggersSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": ["triggers"]
      }
    },
    "/v1/triggers/{type}": {
      "get": {
        "description": "Get a trigger definition by type",
        "parameters": [
          {
            "description": "Trigger type",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTriggerSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/user/interests": {
      "get": {
        "description": "List the authenticated user's captured interests (strongest first)",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListUserInterestsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["user"]
      },
      "post": {
        "description": "Add an interest for the authenticated user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_app_api_http_v1_userinterests.addInterestRequest",
                    "summary": "request",
                    "description": "Interest to add"
                  }
                ]
              }
            }
          },
          "description": "Interest to add",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInterestActionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["user"]
      }
    },
    "/v1/user/interests/settings": {
      "get": {
        "description": "Get the authenticated user's interest-tag opt-in (B3-4674)",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInterestSettingsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["user"]
      },
      "put": {
        "description": "Enable or disable the authenticated user's interest tags (B3-4674)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInterestSettingsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["user"]
      }
    },
    "/v1/user/interests/{tagId}": {
      "delete": {
        "description": "Remove an interest for the authenticated user",
        "parameters": [
          {
            "description": "Interest tag id to remove",
            "in": "path",
            "name": "tagId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInterestActionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "tags": ["user"]
      }
    },
    "/v1/webhook-events": {
      "get": {
        "description": "List webhook events for the organization with pagination",
        "parameters": [
          {
            "description": "Number of events to return (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedData-WebhookEvent"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "List webhook events",
        "tags": ["Webhook Events"]
      }
    },
    "/v1/webhook-events/{eventId}/replay": {
      "post": {
        "description": "Replay a webhook event by re-processing its stored payload",
        "parameters": [
          {
            "description": "Webhook Event ID",
            "in": "path",
            "name": "eventId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Event not found"
          }
        }
      }
    },
    "/v1/webhook/situation": {
      "post": {
        "description": "Handle situation-monitor webhook trigger (situation.created)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SituationMonitorPayload",
                    "summary": "body",
                    "description": "Situation event"
                  }
                ]
              }
            }
          },
          "description": "Situation event",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/workflow-runs/stream": {
      "get": {
        "description": "SSE endpoint that fans the per-workflow run channels for a set of workflow ids into one stream. Pass ids via the comma-separated `ids` query param (max 24). Inaccessible ids are silently dropped.",
        "parameters": [
          {
            "description": "Comma-separated workflow IDs (max 24)",
            "in": "query",
            "name": "ids",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with workflow run events"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Stream run events for multiple workflows",
        "tags": ["workflows"]
      }
    },
    "/v1/workflows": {
      "get": {
        "description": "Get all workflows",
        "parameters": [
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Search in name + description (ILIKE, max 256 chars)",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by status (active|paused|draft|archived)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by trigger type",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by node types (any-match, max 50). Repeat or comma-join.",
            "in": "query",
            "name": "actions",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Filter by connector types (any-match, max 50). Repeat or comma-join.",
            "in": "query",
            "name": "connectors",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Sort: updatedAt:desc (default) | name:asc | createdAt:desc | runs:desc",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Owner scope: yours | org | public | all (everything visible to the caller). Omit for unfiltered; any other value is rejected with 400.",
            "in": "query",
            "name": "owner",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to workflows created_by the caller",
            "in": "query",
            "name": "madeByMe",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsSuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      },
      "post": {
        "description": "Create a new workflow",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateWorkflowParams",
                    "summary": "request",
                    "description": "Workflow details"
                  }
                ]
              }
            }
          },
          "description": "Workflow details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/workflows/analyze-funds": {
      "post": {
        "description": "Analyze the fund requirements of an inline workflow definition without saving or executing it. Same response shape as the workflow-scoped variant, with `workflowId` empty. Read-only — does not consume CU.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/AnalyzeFundsDefinitionParams",
                    "summary": "body",
                    "description": "Inline workflow definition"
                  }
                ]
              }
            }
          },
          "description": "Inline workflow definition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeFundsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid definition"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing org context"
          }
        }
      }
    },
    "/v1/workflows/batch-meta": {
      "post": {
        "description": "Fetch lightweight metadata for multiple workflows in one request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/BatchWorkflowMetaRequest",
                    "summary": "body",
                    "description": "Workflow IDs"
                  }
                ]
              }
            }
          },
          "description": "Workflow IDs",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchWorkflowMetaSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Batch workflow metadata",
        "tags": ["workflows"]
      }
    },
    "/v1/workflows/batch-stats": {
      "post": {
        "description": "Fetch run counts and recent runs for multiple workflows",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/BatchWorkflowStatsRequest",
                    "summary": "body",
                    "description": "Workflow IDs"
                  }
                ]
              }
            }
          },
          "description": "Workflow IDs",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchWorkflowStatsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Batch workflow stats",
        "tags": ["runs"]
      }
    },
    "/v1/workflows/counts": {
      "get": {
        "description": "Get workflow counts grouped by status (filter-aware).",
        "parameters": [
          {
            "description": "Search in name + description (ILIKE, max 256 chars)",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by trigger type",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by node types (any-match, max 50)",
            "in": "query",
            "name": "actions",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Filter by connector types (any-match, max 50)",
            "in": "query",
            "name": "connectors",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Owner scope: yours | org | public | all (everything visible to the caller). Omit for unfiltered; any other value is rejected with 400.",
            "in": "query",
            "name": "owner",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to workflows created_by the caller",
            "in": "query",
            "name": "madeByMe",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowCountsResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/workflows/owner-counts": {
      "get": {
        "description": "Get workflow counts grouped by owner scope (yours/org/public).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowOwnerCountsResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/workflows/validate": {
      "post": {
        "description": "Validate a workflow definition without saving",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ValidateWorkflowParams",
                    "summary": "request",
                    "description": "Workflow definition and name to validate"
                  }
                ]
              }
            }
          },
          "description": "Workflow definition and name to validate",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/workflows/{id}": {
      "delete": {
        "description": "Archive a workflow (soft delete)",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "get": {
        "description": "Get a workflow by ID",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "put": {
        "description": "Update a workflow. A content change creates a new draft version (workflows are immutable); an update whose content matches the current version is a no-op that returns the current version unchanged.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateWorkflowParams",
                    "summary": "request",
                    "description": "New workflow definition"
                  }
                ]
              }
            }
          },
          "description": "New workflow definition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/analyze-funds": {
      "get": {
        "description": "Analyze the fund requirements of a workflow without executing it. Returns resolved (wallet, chain, token, amount) tuples for every action that moves money, plus a `balance` row per requirement when the wallet-balances client is configured. The endpoint is read-only and does not consume CU.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pin analysis to a specific workflow version",
            "in": "query",
            "name": "version",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeFundsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Workflow not found"
          }
        }
      }
    },
    "/v1/workflows/{id}/draft": {
      "delete": {
        "description": "Discard the draft version of a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "get": {
        "description": "Get the draft version of a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/fund-auto-swap": {
      "put": {
        "description": "Update workflow fund auto-swap configuration",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateFundAutoSwapParams",
                    "summary": "body",
                    "description": "Fund auto-swap config"
                  }
                ]
              }
            }
          },
          "description": "Fund auto-swap config",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateFundAutoSwapSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/incoming-links": {
      "get": {
        "description": "List workflows that target this workflow via a `trigger-workflow` action node.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowIncomingLinksResponse"
                }
              }
            },
            "description": "OK"
          }
        }
      }
    },
    "/v1/workflows/{id}/live": {
      "get": {
        "description": "Get the live (active/paused) version of a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/owner": {
      "put": {
        "description": "Transfer workflow ownership to another organization member",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/TransferWorkflowOwnershipParams",
                    "summary": "body",
                    "description": "New workflow owner"
                  }
                ]
              }
            }
          },
          "description": "New workflow owner",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferWorkflowOwnershipSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/pause": {
      "post": {
        "description": "Pause a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/publish": {
      "post": {
        "description": "Publish a draft workflow (validates cronjob intervals, activates)",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/PublishWorkflowParams",
                    "summary": "body",
                    "description": "Optional parameters"
                  }
                ]
              }
            }
          },
          "description": "Optional parameters"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        }
      }
    },
    "/v1/workflows/{id}/refill": {
      "post": {
        "description": "Refill remaining runs for a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RefillWorkflowParams",
                    "summary": "request",
                    "description": "New remain_runs value"
                  }
                ]
              }
            }
          },
          "description": "New remain_runs value",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefillWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/regenerate-descriptions": {
      "post": {
        "description": "Regenerate AI descriptions for a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegenerateDescriptionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/workflows/{id}/release": {
      "post": {
        "description": "Publish a workflow and its generated app together as one release",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/PublishReleaseParams",
                    "summary": "body",
                    "description": "Optional parameters"
                  }
                ]
              }
            }
          },
          "description": "Optional parameters"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        }
      }
    },
    "/v1/workflows/{id}/releases": {
      "get": {
        "description": "List the release history of a workflow (newest first)",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Page offset",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/workflows/{id}/releases/{releaseVersion}/revert": {
      "post": {
        "description": "Revert a workflow to a prior release (workflow + generated app)",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Release version to revert to",
            "in": "path",
            "name": "releaseVersion",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/resolve": {
      "get": {
        "description": "Returns the organization info for a workflow and whether the authenticated user is a member",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Resolve workflow organization",
        "tags": ["workflow"]
      }
    },
    "/v1/workflows/{id}/resume": {
      "post": {
        "description": "Resume a paused workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/revert-to-version": {
      "post": {
        "description": "Revert a workflow to a prior workflow version (records a release with no app)",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RevertToVersionParams",
                    "summary": "body",
                    "description": "Target workflow version"
                  }
                ]
              }
            }
          },
          "description": "Target workflow version",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/rollback": {
      "post": {
        "description": "Rollback workflow to a previous version",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RollbackWorkflowParams",
                    "summary": "body",
                    "description": "Rollback params"
                  }
                ]
              }
            }
          },
          "description": "Rollback params",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackWorkflowSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/run": {
      "post": {
        "description": "Run a workflow with optional payload. Works for draft, active, and paused workflows. Does not count against maxRuns or enforce cooldown.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/RunParams",
                    "summary": "body",
                    "description": "Optional payload"
                  }
                ]
              }
            }
          },
          "description": "Optional payload"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request or workflow is archived"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Workflow not found"
          }
        }
      }
    },
    "/v1/workflows/{id}/runs": {
      "get": {
        "description": "List all runs for a specific workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by run status (running, waiting, success, partial, failure, cancelled)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/runs/count": {
      "get": {
        "description": "Count runs for a specific workflow, grouped by status",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountWorkflowRunsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/runs/stream": {
      "get": {
        "description": "SSE endpoint for real-time notifications when runs start/complete for a workflow.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "SSE stream with workflow run events"
          },
          "400": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Stream workflow run events",
        "tags": ["workflows"]
      }
    },
    "/v1/workflows/{id}/schedule": {
      "get": {
        "description": "Get next run time for a scheduled workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_app_api_http_v1_workflow.WorkflowScheduleResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/trigger-aggregates": {
      "get": {
        "description": "Per-trigger run aggregates (last fired, run count, success / failure breakdown, next fire preview) for a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTriggerAggregatesResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/trigger-info": {
      "get": {
        "description": "Get trigger info (e.g. Pipedream email address) for a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTriggerInfoSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/ui-metadata": {
      "patch": {
        "description": "Update workflow UI metadata (node positions) in-place",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateWorkflowUIMetadataParams",
                    "summary": "request",
                    "description": "UI metadata"
                  }
                ]
              }
            }
          },
          "description": "UI metadata",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateWorkflowUIMetadataSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        }
      }
    },
    "/v1/workflows/{id}/unarchive": {
      "post": {
        "description": "Unarchive a workflow — restores the latest archived version\nto the draft state so it can be edited and re-published.",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Unarchive a workflow",
        "tags": ["workflows"]
      }
    },
    "/v1/workflows/{id}/versions": {
      "get": {
        "description": "List all versions of a workflow",
        "parameters": [
          {
            "description": "Workflow ID (any version)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of items (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowVersionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/versions/count": {
      "get": {
        "description": "Count total versions for a specific workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountWorkflowVersionsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/versions/{versionNumber}": {
      "get": {
        "description": "Get a specific version of a workflow by version number",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Version number",
            "in": "path",
            "name": "versionNumber",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkflowVersionSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/visibility": {
      "put": {
        "description": "Update workflow visibility level",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateVisibilityParams",
                    "summary": "body",
                    "description": "Visibility level"
                  }
                ]
              }
            }
          },
          "description": "Visibility level",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateVisibilitySuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{id}/widget": {
      "delete": {
        "description": "Disable public widget for a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      },
      "post": {
        "description": "Enable public widget for a workflow",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/PublishWidgetParams",
                    "summary": "body",
                    "description": "Widget configuration"
                  }
                ]
              }
            }
          },
          "description": "Widget configuration",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishWidgetSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/variables": {
      "get": {
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowVariablesResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "List workflow variables",
        "tags": ["WorkflowVariables"]
      }
    },
    "/v1/workflows/{workflowId}/variables/{name}": {
      "delete": {
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Variable name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Delete workflow variable",
        "tags": ["WorkflowVariables"]
      },
      "put": {
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Variable name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/UpsertWorkflowVariableDefParams",
                    "summary": "body",
                    "description": "Variable definition"
                  }
                ]
              }
            }
          },
          "description": "Variable definition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariableDef"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Create or update workflow variable definition",
        "tags": ["WorkflowVariables"]
      }
    },
    "/v1/workflows/{workflowId}/variables/{name}/history": {
      "get": {
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Variable name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max rows per page",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVariableHistoryResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Workflow variable write history",
        "tags": ["WorkflowVariables"]
      }
    },
    "/v1/workflows/{workflowId}/variables/{name}/reset": {
      "post": {
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Variable name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Reset workflow variable to default",
        "tags": ["WorkflowVariables"]
      }
    },
    "/v1/workflows/{workflowId}/variables/{name}/value": {
      "post": {
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Variable name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/SetWorkflowVariableValueParams",
                    "summary": "body",
                    "description": "New value"
                  }
                ]
              }
            }
          },
          "description": "New value",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Manually set workflow variable value",
        "tags": ["WorkflowVariables"]
      }
    },
    "/v1/x402-endpoints": {
      "get": {
        "description": "List all public x402 endpoints",
        "parameters": [
          {
            "description": "Filter by category",
            "in": "query",
            "name": "category",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search in name and description",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit (default 20, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListX402EndpointsSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      },
      "post": {
        "description": "Create (import) a new x402 endpoint after successful test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/CreateX402EndpointParams",
                    "summary": "request",
                    "description": "Endpoint details"
                  }
                ]
              }
            }
          },
          "description": "Endpoint details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/x402-endpoints/by-url": {
      "get": {
        "description": "Check if an x402 endpoint exists by URL",
        "parameters": [
          {
            "description": "Resource URL to check",
            "in": "query",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/x402-endpoints/execute": {
      "post": {
        "description": "Execute an x402 call with a pre-signed payment header (proxy mode)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ExecuteX402EndpointParams",
                    "summary": "request",
                    "description": "Execute parameters"
                  }
                ]
              }
            }
          },
          "description": "Execute parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecuteX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/x402-endpoints/generate-metadata": {
      "post": {
        "description": "Generate AI metadata (name, description, category, tags) for an x402 endpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/GenerateX402MetadataParams",
                    "summary": "request",
                    "description": "Endpoint details for metadata generation"
                  }
                ]
              }
            }
          },
          "description": "Endpoint details for metadata generation",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateX402MetadataSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/x402-endpoints/import": {
      "post": {
        "description": "Import an x402 endpoint atomically (probe + pay + generate metadata + create)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ImportX402EndpointParams",
                    "summary": "request",
                    "description": "Import parameters"
                  }
                ]
              }
            }
          },
          "description": "Import parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        }
      }
    },
    "/v1/x402-endpoints/probe": {
      "post": {
        "description": "Probe an x402 endpoint to get its payment requirements",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/ProbeX402EndpointParams",
                    "summary": "request",
                    "description": "Endpoint URL to probe"
                  }
                ]
              }
            }
          },
          "description": "Endpoint URL to probe",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProbeX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        }
      }
    },
    "/v1/x402-endpoints/test": {
      "post": {
        "description": "Test an x402 endpoint using the organization's default Turnkey wallet",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/TestX402EndpointParams",
                    "summary": "request",
                    "description": "Test parameters"
                  }
                ]
              }
            }
          },
          "description": "Test parameters",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v1/x402-endpoints/{id}": {
      "get": {
        "description": "Get an x402 endpoint by ID",
        "parameters": [
          {
            "description": "Endpoint ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/v1/x402-endpoints/{id}/verify": {
      "post": {
        "description": "Re-verify an x402 endpoint and update its schemas",
        "parameters": [
          {
            "description": "Endpoint ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/VerifyX402EndpointParams",
                    "summary": "request",
                    "description": "New schemas from re-test"
                  }
                ]
              }
            }
          },
          "description": "New schemas from re-test",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyX402EndpointSuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    }
  },
  "openapi": "3.1.0"
}
