{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "FastHook Control API — Partial contract",
    "version": "0.25.0",
    "description": "A deliberately partial contract for stable FastHook Control API surfaces. It does not claim coverage of the complete Control API."
  },
  "servers": [
    {
      "url": "https://api.fasthook.io"
    }
  ],
  "tags": [
    {
      "name": "Project API keys"
    },
    {
      "name": "Filters"
    },
    {
      "name": "Workflow Formatter"
    },
    {
      "name": "Transformations"
    },
    {
      "name": "Workflows"
    },
    {
      "name": "Actions"
    },
    {
      "name": "Connections"
    },
    {
      "name": "Sources"
    },
    {
      "name": "Destinations"
    },
    {
      "name": "Provider accounts"
    },
    {
      "name": "Provider catalogs"
    },
    {
      "name": "Action options"
    },
    {
      "name": "Metrics"
    },
    {
      "name": "Requests"
    },
    {
      "name": "Request bulk operations"
    },
    {
      "name": "Events"
    },
    {
      "name": "Attempts"
    },
    {
      "name": "Event bulk operations"
    },
    {
      "name": "Source operations"
    },
    {
      "name": "Request Fixtures"
    },
    {
      "name": "Public request shares"
    },
    {
      "name": "Workflow Templates"
    },
    {
      "name": "Workflow activity"
    },
    {
      "name": "Workflow Aggregate"
    }
  ],
  "x-fasthook-contract-coverage": {
    "status": "partial",
    "surfaces": [
      "project-api-keys",
      "filter-crud",
      "filter-test",
      "workflow-formatter",
      "transformation-crud",
      "transformation-execution-history",
      "transformation-test",
      "transformation-capabilities",
      "workflow-crud",
      "workflow-testing",
      "workflow-run-history",
      "workflow-step-retry",
      "action-crud",
      "connection-crud",
      "connection-latest-input",
      "source-crud",
      "destination-crud",
      "provider-accounts",
      "provider-catalogs",
      "action-options",
      "resource-metrics",
      "request-reads",
      "event-attempt-reads",
      "request-event-mutations",
      "source-operations",
      "request-fixtures",
      "public-request-shares",
      "workflow-templates",
      "workflow-activity",
      "workflow-aggregate"
    ],
    "sourceFiles": [
      "src/control-api.ts",
      "src/control-api-authorization.ts",
      "src/action-catalog.ts",
      "src/control-api-action-provider-options.ts",
      "src/control-api-actions.ts",
      "src/control-api-destination-config.ts",
      "src/control-api-destination-policy.ts",
      "src/control-api-filters.ts",
      "src/control-api-formatter.ts",
      "src/control-api-fixtures.ts",
      "src/control-api-provider-accounts.ts",
      "src/control-api-batch-operations.ts",
      "src/control-api-events-query.ts",
      "src/control-api-request-shares.ts",
      "src/control-api-requests-events.ts",
      "src/control-api-resources.ts",
      "src/control-api-source-resources.ts",
      "src/control-api-triggers.ts",
      "src/trigger-catalog.ts",
      "src/control-api-transformations.ts",
      "src/control-api-workflows.ts",
      "src/filter-rule.ts",
      "src/project-api-keys.ts",
      "src/workflow-template-catalog.ts",
      "src/control-api-aggregate.ts"
    ],
    "excluded": [
      "Internal, administrative, authentication, OAuth callback, public-bin data-plane, and compatibility Control API surfaces not declared as supported external contract operations",
      "Public-bin data-plane and remaining internal-only surfaces",
      "The legacy /v1/destinations/metrics alias and legacy POST enable/disable aliases, whose legacy response DTO differs from the canonical Destination projection",
      "Legacy google-oauth Provider Account aliases, direct-handler-test-only OAuth paths, OAuth state/credential storage internals, and provider subscription/channel cleanup internals",
      "Dashboard proxy paths under /api/control",
      "CLI commands and widget runtime surfaces; synchronized artifacts do not imply owner-session feature support",
      "The hand-authored public documentation OpenAPI document"
    ]
  },
  "paths": {
    "/v1/project-api-keys": {
      "get": {
        "operationId": "listProjectApiKeys",
        "summary": "List project API keys",
        "description": "Returns at most 100 keys for the selected team without raw credentials or hashes.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Project API keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createProjectApiKey",
        "summary": "Create a project API key",
        "description": "Creates a key and returns its raw credential exactly once with Cache-Control: no-store.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created key and one-time credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateProjectApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid key policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The non-revoked key limit was reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/project-api-keys/{keyId}": {
      "get": {
        "operationId": "retrieveProjectApiKey",
        "summary": "Retrieve a project API key",
        "description": "Returns key metadata without the raw credential or its hash.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "description": "Stable pak_* key identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProjectApiKeyId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateProjectApiKey",
        "summary": "Update a project API key",
        "description": "Partially updates mutable metadata and policy. Revoked keys cannot be changed.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "description": "Stable pak_* key identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProjectApiKeyId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated project API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid key policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Revoked key or gated legacy policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceProjectApiKey",
        "summary": "Update a project API key using PUT",
        "description": "Uses the same partial-update semantics as PATCH; omitted fields retain their current values.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "description": "Stable pak_* key identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProjectApiKeyId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated project API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid key policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Revoked key or gated legacy policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteProjectApiKey",
        "summary": "Permanently revoke a project API key",
        "description": "DELETE is an idempotent permanent revocation and returns the resulting key metadata.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "description": "Stable pak_* key identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProjectApiKeyId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked project API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Legacy policy cutover is not complete",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/project-api-keys/{keyId}/revoke": {
      "post": {
        "operationId": "revokeProjectApiKey",
        "summary": "Permanently revoke a project API key",
        "description": "Explicit revocation alias for clients that do not use DELETE.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "description": "Stable pak_* key identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProjectApiKeyId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked project API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Legacy policy cutover is not complete",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/project-api-keys/{keyId}/audit": {
      "get": {
        "operationId": "listProjectApiKeyAudit",
        "summary": "List project API key audit decisions",
        "description": "Returns at most 100 coalesced audit decisions for the selected key.",
        "tags": [
          "Project API keys"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "description": "Stable pak_* key identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProjectApiKeyId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project API key audit entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyAuditListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/filters": {
      "get": {
        "operationId": "listFilters",
        "summary": "List stored filters",
        "description": "Returns the selected team's bounded stored Filter models using the route's default pagination order.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Stored Filters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team read access or the project-key read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createFilter",
        "summary": "Create a stored filter",
        "description": "Creates a named reusable Filter for the selected team.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFilterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created Filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name or empty conditions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A Filter with the same name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterAlreadyExistsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/filters/{filterId}": {
      "get": {
        "operationId": "retrieveFilter",
        "summary": "Retrieve a stored filter",
        "description": "Returns one stored Filter and its linked-Connection summary.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "filterId",
            "in": "path",
            "required": true,
            "description": "Stored Filter identifier.",
            "schema": {
              "$ref": "#/components/schemas/FilterId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stored Filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team read access or the project-key read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Filter not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateFilter",
        "summary": "Update a stored filter",
        "description": "Updates a Filter and refreshes snapshots for linked Connections.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "filterId",
            "in": "path",
            "required": true,
            "description": "Stored Filter identifier.",
            "schema": {
              "$ref": "#/components/schemas/FilterId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFilterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name or empty conditions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Filter not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A Filter with the same name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterAlreadyExistsResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceFilter",
        "summary": "Update a stored filter using PUT",
        "description": "Uses the same partial-update and linked-snapshot semantics as PATCH.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "filterId",
            "in": "path",
            "required": true,
            "description": "Stored Filter identifier.",
            "schema": {
              "$ref": "#/components/schemas/FilterId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFilterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name or empty conditions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Filter not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A Filter with the same name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterAlreadyExistsResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteFilter",
        "summary": "Delete a stored filter",
        "description": "Deletes a Filter after detaching its immutable conditions into linked Connection snapshots.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "filterId",
            "in": "path",
            "required": true,
            "description": "Stored Filter identifier.",
            "schema": {
              "$ref": "#/components/schemas/FilterId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted Filter identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFilterResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Filter not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/filters/test": {
      "post": {
        "operationId": "testFilter",
        "summary": "Test filter conditions",
        "description": "Evaluates filter conditions against a supplied request envelope without storing either value.",
        "tags": [
          "Filters"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilterTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Filter evaluation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or empty filter conditions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-formatter/catalog": {
      "get": {
        "operationId": "getWorkflowFormatterCatalog",
        "summary": "Get the Workflow Formatter catalog",
        "description": "Returns the versioned categories, operations, dynamic input fields, line-item policies, limits, and output schemas implemented by the Workflow Formatter runtime.",
        "tags": [
          "Workflow Formatter"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Versioned Workflow Formatter catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowFormatterCatalogResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-formatter/test": {
      "post": {
        "operationId": "testWorkflowFormatter",
        "summary": "Test a Workflow Formatter configuration",
        "description": "Resolves mapped sample inputs and executes the same pure versioned Formatter engine used by Workflow runtime without storing data or causing external side effects.",
        "tags": [
          "Workflow Formatter"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowFormatterTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved input, output, output schema, and warnings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowFormatterTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request envelope or anchor timestamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Formatter test request exceeds the body limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Formatter config, mapped input, or execution is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowFormatterErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations": {
      "get": {
        "operationId": "listTransformations",
        "summary": "List stored transformations",
        "description": "Returns the selected team's stored Transformations. The default response omits database-wide execution aggregation and reports zeroed metrics.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Stored Transformations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createTransformation",
        "summary": "Create a stored transformation",
        "description": "Validates and stores a named FastHook DSL Transformation for the selected team.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransformationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created Transformation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name, request body, or transformation code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A Transformation with the same name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationAlreadyExistsResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsertTransformation",
        "summary": "Upsert a stored transformation by name",
        "description": "Creates a named FastHook DSL Transformation or replaces the existing Transformation with the same name.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransformationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created or updated Transformation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name, request body, or transformation code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations/{transformationId}": {
      "get": {
        "operationId": "retrieveTransformation",
        "summary": "Retrieve a stored transformation",
        "description": "Returns one stored Transformation with its current execution and linked-Connection metrics.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "transformationId",
            "in": "path",
            "required": true,
            "description": "Stored Transformation identifier.",
            "schema": {
              "$ref": "#/components/schemas/TransformationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stored Transformation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Transformation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateTransformation",
        "summary": "Update a stored transformation",
        "description": "Partially updates a stored Transformation, validates the resulting DSL code, and refreshes its runtime cache.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "transformationId",
            "in": "path",
            "required": true,
            "description": "Stored Transformation identifier.",
            "schema": {
              "$ref": "#/components/schemas/TransformationId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTransformationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Transformation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name, request body, or transformation code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Transformation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTransformation",
        "summary": "Delete a stored transformation",
        "description": "Deletes the selected team's Transformation if present and clears its runtime cache.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "transformationId",
            "in": "path",
            "required": true,
            "description": "Stored Transformation identifier.",
            "schema": {
              "$ref": "#/components/schemas/TransformationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted Transformation identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTransformationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A project owner or site-admin session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations/{transformationId}/executions": {
      "get": {
        "operationId": "listTransformationExecutions",
        "summary": "List transformation executions",
        "description": "Returns a bounded page of execution summaries for one stored Transformation across the readable Event shards.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "transformationId",
            "in": "path",
            "required": true,
            "description": "Stored Transformation identifier.",
            "schema": {
              "$ref": "#/components/schemas/TransformationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transformation execution summaries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationExecutionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations/{transformationId}/executions/{executionId}": {
      "get": {
        "operationId": "retrieveTransformationExecution",
        "summary": "Retrieve a transformation execution",
        "description": "Returns one execution with its stored original and transformed Event-data snapshots.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "transformationId",
            "in": "path",
            "required": true,
            "description": "Stored Transformation identifier.",
            "schema": {
              "$ref": "#/components/schemas/TransformationId"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "description": "Transformation execution identifier.",
            "schema": {
              "$ref": "#/components/schemas/TransformationExecutionId"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "description": "Optional Request ID routing hint returned by transformation execution models. A valid hint avoids a cross-shard lookup; an absent or stale hint preserves the normal fallback lookup.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transformation execution detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationExecutionDetail"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Transformation execution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations/capabilities": {
      "get": {
        "operationId": "getTransformationCapabilities",
        "summary": "Get transformation capabilities",
        "description": "Returns the authoritative FastHook DSL runtime limits and supported globals, namespaces, methods, properties, and contextual members.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Transformation runtime capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationCapabilitiesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations/validate": {
      "put": {
        "operationId": "validateTransformation",
        "summary": "Validate transformation code",
        "description": "Validates FastHook DSL code and returns its runtime capabilities without executing or storing it.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransformationValidateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transformation validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationValidateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or unsupported transformation code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transformations/run": {
      "put": {
        "operationId": "runTransformation",
        "summary": "Run a transformation preview",
        "description": "Executes supplied FastHook DSL code against a request envelope without persisting an execution.",
        "tags": [
          "Transformations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransformationRunRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transformation preview result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationRunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or transformation execution failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Stored transformation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "List workflows",
        "description": "Returns the selected team's bounded Workflow summaries and their currently advertised sequential capabilities.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow summaries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWorkflow",
        "summary": "Create a workflow",
        "description": "Creates a sequential Workflow graph and persists its immutable version snapshot.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created Workflow graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced Source or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Workflow name conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Workflow cannot be activated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}": {
      "get": {
        "operationId": "retrieveWorkflow",
        "summary": "Retrieve a workflow",
        "description": "Returns one Workflow with its editable sequential graph and current runtime capability assessment.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow graph and capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDetail"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceWorkflow",
        "summary": "Replace a workflow",
        "description": "Updates a Workflow graph using optimistic version checking and writes the next immutable version snapshot.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Workflow graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or referenced resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Version or name conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Workflow cannot be activated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWorkflow",
        "summary": "Update a workflow",
        "description": "Partially updates a Workflow graph using optimistic version checking and writes the next immutable version snapshot.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Workflow graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or referenced resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Version or name conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Workflow cannot be activated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkflow",
        "summary": "Delete a workflow",
        "description": "Deletes a Workflow after its R2 artifact lifecycle fence confirms deletion is safe.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow deletion result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteWorkflowResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "R2 artifact deletion is not safe yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/runs": {
      "get": {
        "operationId": "listWorkflowRuns",
        "summary": "List workflow runs",
        "description": "Returns a bounded newest-first page of Workflow and pre-input Trigger failures. Query parameters use server defaults in generated clients.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow run page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid pagination cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "clearWorkflowRuns",
        "summary": "Clear completed workflow runs",
        "description": "Deletes completed run records while retaining queued or running executions and respecting R2 artifact lifecycle fences.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run cleanup result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClearWorkflowRunsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "R2 artifact deletion is not safe yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/runs/{runId}": {
      "get": {
        "operationId": "retrieveWorkflowRun",
        "summary": "Retrieve a workflow run",
        "description": "Returns one Workflow or pre-input Trigger failure with immutable version metadata and Step execution details. Data previews remain opt-in through the raw API query parameter.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "Workflow or Trigger-run identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowRunId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow run detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunDetail"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or run not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/runs/{runId}/retry": {
      "post": {
        "operationId": "retryWorkflowStep",
        "summary": "Retry a failed workflow step",
        "description": "Retry a failed Step, or a saved failed Loop iteration selected by full iteration_path. Completed sibling Actions and downstream steps are preserved; stopped runs resume unexecuted continuation.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "Failed Workflow run identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowRunId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetryWorkflowStepRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Retry queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryWorkflowStepResponse"
                }
              }
            }
          },
          "400": {
            "description": "step_id is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow run or Step run not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Retry is unsafe or already queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Trigger payload is no longer available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/test-data": {
      "get": {
        "operationId": "retrieveWorkflowTestData",
        "summary": "Retrieve workflow test data",
        "description": "Returns the latest trigger sample and step data available to the Workflow test surface.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow test data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTestDataResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/test-trigger": {
      "post": {
        "operationId": "triggerWorkflowTest",
        "summary": "Trigger a workflow test",
        "description": "Starts a provider trigger test and returns the available test records.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowTestTriggerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workflow trigger test records",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTestTriggerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid trigger test request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or provider account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/test-selection": {
      "post": {
        "operationId": "selectWorkflowTestRecord",
        "summary": "Select a workflow test record",
        "description": "Selects one trigger record from a workflow test bundle for subsequent test execution.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowTestSelectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workflow test record selected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTestSelectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid test selection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or test record not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/test-loop-step": {
      "post": {
        "operationId": "testWorkflowLoopStep",
        "summary": "Preview a saved Loop tool step",
        "description": "Runs a saved Loop Transformation or JSON Patch. Delay and Destination return simulated pass-through results without waiting or delivery.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowTestLoopStepRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Loop tool preview result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTestLoopStepResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid workflow action test request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/test-action": {
      "post": {
        "operationId": "testWorkflowAction",
        "summary": "Test a workflow action",
        "description": "Executes one workflow action with supplied inputs and returns its result without creating a workflow run.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowTestActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workflow action test result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTestActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid workflow action test request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/actions": {
      "get": {
        "operationId": "listActions",
        "summary": "List actions",
        "description": "Returns the team's reusable Actions with public configuration, schema provenance, and Workflow usage counts; credential material is never returned.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Reusable Actions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAction",
        "summary": "Create an action",
        "description": "Creates a reusable Action, validates its provider account and enabled remote configuration, and stores an immutable revision.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Action configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Action name or provider-account conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/actions/{actionId}": {
      "get": {
        "operationId": "retrieveAction",
        "summary": "Retrieve an action",
        "description": "Returns one reusable Action with secret-free public configuration and current Workflow usage count.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reusable Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceAction",
        "summary": "Replace an action",
        "description": "Updates mutable Action metadata and configuration and stores a content-addressed immutable revision.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Action configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Action name or provider-account conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateAction",
        "summary": "Update an action",
        "description": "Partially updates mutable Action metadata or configuration and stores a content-addressed immutable revision.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Action configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Action name or provider-account conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAction",
        "summary": "Delete an action",
        "description": "Deletes an unused reusable Action and invalidates affected Connection and delivery-target caches.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Action deletion result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteActionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Action is used by a Workflow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/actions/{actionId}/enable": {
      "put": {
        "operationId": "enableAction",
        "summary": "Enable an action",
        "description": "Validates the stored provider configuration and enables the Action.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "400": {
            "description": "Stored Action configuration cannot be enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "enableActionPost",
        "summary": "Enable an action with POST",
        "description": "Compatibility alias for enabling an Action after validating its stored provider configuration.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "400": {
            "description": "Stored Action configuration cannot be enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/actions/{actionId}/disable": {
      "put": {
        "operationId": "disableAction",
        "summary": "Disable an action",
        "description": "Disables the Action and evicts its delivery-target cache entry.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "disableActionPost",
        "summary": "Disable an action with POST",
        "description": "Compatibility alias for disabling the Action and evicting its delivery-target cache entry.",
        "tags": [
          "Actions"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "description": "Stable act_* Action identifier.",
            "schema": {
              "$ref": "#/components/schemas/ActionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections": {
      "get": {
        "operationId": "listConnections",
        "summary": "List connections",
        "description": "Returns a bounded page of Connections with canonical runtime rules and embedded secret-free Source and destination projections. Generated clients use server query defaults.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Connection page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createConnection",
        "summary": "Create a connection",
        "description": "Creates a Source-to-destination Connection, canonicalizes rules, updates rule indexes, and publishes its cache entry.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Connection or rule configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsertConnection",
        "summary": "Upsert a connection",
        "description": "Updates by stable id or Source-scoped name when present, otherwise creates a Connection.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upserted Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Connection or rule configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections/{connectionId}": {
      "get": {
        "operationId": "retrieveConnection",
        "summary": "Retrieve a connection",
        "description": "Returns one Connection with canonical runtime rules and embedded secret-free resources.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceConnection",
        "summary": "Replace a connection",
        "description": "Updates a Connection, canonicalizes rules, refreshes rule indexes and caches, and drains paused Events when resumed.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Connection or rule configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateConnection",
        "summary": "Update a connection",
        "description": "Partially updates a Connection while preserving omitted fields and synchronizing indexes and caches.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Connection or rule configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteConnection",
        "summary": "Delete a connection",
        "description": "Deletes a Connection and invalidates its Connection and Source-active caches.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection deletion result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteConnectionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections/{connectionId}/latest-input": {
      "get": {
        "operationId": "retrieveConnectionLatestInput",
        "summary": "Retrieve the latest connection input",
        "description": "Returns the latest Source request input for mapping previews, using coverage-gated routing and an exact bounded scatter fallback.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Latest Connection input or null",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionLatestInputResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections/{connectionId}/enable": {
      "put": {
        "operationId": "enableConnection",
        "summary": "Enable a connection",
        "description": "Enables a Connection and refreshes its runtime caches.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "enableConnectionPost",
        "summary": "Enable a connection with POST",
        "description": "Compatibility alias for enabling a Connection and refreshing its runtime caches.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections/{connectionId}/disable": {
      "put": {
        "operationId": "disableConnection",
        "summary": "Disable a connection",
        "description": "Disables a Connection and refreshes its runtime caches.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "disableConnectionPost",
        "summary": "Disable a connection with POST",
        "description": "Compatibility alias for disabling a Connection and refreshing its runtime caches.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections/{connectionId}/pause": {
      "put": {
        "operationId": "pauseConnection",
        "summary": "Pause a connection",
        "description": "Pauses delivery for a Connection without disabling it.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paused Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/connections/{connectionId}/unpause": {
      "put": {
        "operationId": "unpauseConnection",
        "summary": "Unpause a connection",
        "description": "Resumes a paused Connection and schedules draining of its deferred Events.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Stable web_* Connection identifier.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resumed Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources": {
      "get": {
        "operationId": "listSources",
        "summary": "List sources",
        "description": "Returns a bounded page of webhook and provider Sources with secret-redacted configuration. Generated clients use server query defaults.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Source page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Source filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createSource",
        "summary": "Create a source",
        "description": "Creates a webhook Source, or an app Source when input_type is provider_trigger or definition_key is supplied. Secret fields are encrypted before persistence.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Source configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source already exists or provider prerequisites are unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsertSource",
        "summary": "Upsert a webhook source",
        "description": "Updates a webhook Source by name when present, otherwise creates one.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upserted Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Source configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source URL conflicts with an existing Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}": {
      "get": {
        "operationId": "retrieveSource",
        "summary": "Retrieve a source",
        "description": "Returns one webhook or provider Source with secret-redacted configuration.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceSource",
        "summary": "Replace a source",
        "description": "Updates a webhook or provider Source. Provider identity and definition cannot be changed through this route.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Source configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source configuration conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateSource",
        "summary": "Update a source",
        "description": "Partially updates a webhook or provider Source while preserving omitted fields.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Source configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source configuration conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSource",
        "summary": "Delete a source",
        "description": "Deletes a webhook Source and invalidates its lookup cache. Webhook Sources still attached to Workflows cannot be deleted; provider-Source deletion is outside this partial response contract.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source deletion result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteSourceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source is still attached to a Workflow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/enable": {
      "put": {
        "operationId": "enableSource",
        "summary": "Enable a source",
        "description": "Enables a Source; provider Sources require a valid connected account and required scopes.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Provider account is not ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "enableSourcePost",
        "summary": "Enable a source with POST",
        "description": "Compatibility alias for enabling a Source.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Provider account is not ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/disable": {
      "put": {
        "operationId": "disableSource",
        "summary": "Disable a source",
        "description": "Disables a Source; webhook Sources also disable their Connections.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "disableSourcePost",
        "summary": "Disable a source with POST",
        "description": "Compatibility alias for disabling a Source.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/destinations": {
      "get": {
        "operationId": "listDestinations",
        "summary": "List destinations",
        "description": "Returns a bounded page of transport Destinations with secret-redacted configuration. Attempt metrics are zero unless include_metrics is enabled; generated clients use server query defaults.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Destination page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createDestination",
        "summary": "Create a destination",
        "description": "Creates an enabled transport Destination. SaaS operations belong to Actions; ACTION and removed provider-like legacy Destination types are rejected.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DestinationCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Destination configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Destination name or endpoint already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsertDestination",
        "summary": "Upsert a destination",
        "description": "Replaces a transport Destination by name when present, otherwise creates an enabled Destination.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DestinationCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upserted Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Destination configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Destination endpoint conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/destinations/{destinationId}": {
      "get": {
        "operationId": "retrieveDestination",
        "summary": "Retrieve a destination",
        "description": "Returns one transport Destination with secret-redacted configuration and its current 24-hour attempt metrics.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "Stable des_* Destination identifier.",
            "schema": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Destination not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceDestination",
        "summary": "Replace a destination",
        "description": "Replaces a transport Destination with a complete payload while preserving matching redacted secret placeholders.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "Stable des_* Destination identifier.",
            "schema": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DestinationReplaceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Destination configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Destination not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Destination endpoint conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateDestination",
        "summary": "Update a destination",
        "description": "Merges supplied fields and configuration into a transport Destination while preserving omitted values and matching redacted secrets.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "Stable des_* Destination identifier.",
            "schema": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DestinationUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Destination configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Destination not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Destination endpoint conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDestination",
        "summary": "Delete a destination",
        "description": "Deletes a transport Destination and invalidates its delivery-target cache. The operation is idempotent and returns the requested id even when it was already absent.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "Stable des_* Destination identifier.",
            "schema": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Destination deletion result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDestinationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/destinations/{destinationId}/enable": {
      "put": {
        "operationId": "enableDestination",
        "summary": "Enable a destination",
        "description": "Enables a transport Destination, clears disabled_at, persists the cache projection, and returns the new state.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "Stable des_* Destination identifier.",
            "schema": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Destination not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/destinations/{destinationId}/disable": {
      "put": {
        "operationId": "disableDestination",
        "summary": "Disable a destination",
        "description": "Disables a transport Destination, sets disabled_at, persists the cache projection, and returns the new state.",
        "tags": [
          "Destinations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "Stable des_* Destination identifier.",
            "schema": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled Destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Destination not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider-accounts": {
      "get": {
        "operationId": "listProviderAccounts",
        "summary": "List connected provider accounts",
        "description": "Returns secret-free connected-account projections for the selected team. An optional provider_key query filter is supported by the server.",
        "tags": [
          "Provider accounts"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Connected provider accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAccountListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider-accounts/oauth/start": {
      "post": {
        "operationId": "startProviderOAuth",
        "summary": "Start provider OAuth",
        "description": "Creates a user-, team-, and provider-bound OAuth state with a ten-minute lifetime and returns the provider authorization URL.",
        "tags": [
          "Provider accounts"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderOAuthStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OAuth authorization request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderOAuthStartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider, resource, or authorization context",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Project-owner dashboard session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Provider OAuth is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider-accounts/oauth/callback": {
      "post": {
        "operationId": "completeProviderOAuth",
        "summary": "Complete provider OAuth",
        "description": "Consumes a single-use OAuth state bound to the current dashboard user and team, encrypts provider credentials, and returns the connected account.",
        "tags": [
          "Provider accounts"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderOAuthCallbackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected provider account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAccountModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid code, state, or provider response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Project-owner dashboard session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "OAuth state was already consumed or required scopes were not granted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider-accounts/credentials/connect": {
      "post": {
        "operationId": "connectProviderCredentials",
        "summary": "Connect provider credentials",
        "description": "Validates an API-key provider credential payload, encrypts it at rest, and returns a secret-free account projection.",
        "tags": [
          "Provider accounts"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderCredentialConnectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected provider account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAccountModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider or credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Project-owner dashboard session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider-accounts/{accountId}/options": {
      "get": {
        "operationId": "listProviderAccountOptions",
        "summary": "List provider account options",
        "description": "Browses a provider-specific resource such as channels, repositories, boards, or event types without exposing credentials.",
        "tags": [
          "Provider accounts"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Stable pac_* Provider Account identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProviderAccountId"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": true,
            "description": "Provider-specific resource category to browse.",
            "schema": {
              "$ref": "#/components/schemas/ProviderAccountOptionsResource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provider resource options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAccountOptionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Enabled provider account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Requested options are unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Provider options request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider-accounts/{accountId}": {
      "delete": {
        "operationId": "revokeProviderAccount",
        "summary": "Revoke a provider account",
        "description": "Revokes remote credentials where supported, erases local credentials, disables dependent Sources and Actions, and stops managed channels/subscriptions.",
        "tags": [
          "Provider accounts"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Stable pac_* Provider Account identifier.",
            "schema": {
              "$ref": "#/components/schemas/ProviderAccountId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provider account revoke result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAccountRevokeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-owner or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Remote subscriptions could not be removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Provider subscription cleanup is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/action-providers": {
      "get": {
        "operationId": "listActionProviders",
        "summary": "List Action providers",
        "description": "Returns the versioned Action provider catalog, including public authentication metadata, Action schemas, samples, capabilities, and schema provenance. No connected-account credentials are returned.",
        "tags": [
          "Provider catalogs"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Action provider catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionProviderListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/source-providers": {
      "get": {
        "operationId": "listSourceProviders",
        "summary": "List Source providers",
        "description": "Returns the versioned Source and Trigger provider catalog, including public auth metadata, configuration fields, event schemas, samples, capabilities, and schema provenance. Runtime adapters and credentials are not returned.",
        "tags": [
          "Provider catalogs"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Source provider catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceProviderListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/action-options": {
      "post": {
        "operationId": "listActionOptions",
        "summary": "Browse dynamic Action options",
        "description": "Searches or pages provider-specific resources for Action configuration. This credential-adjacent read is intentionally dashboard-session-only: it may use a connected account, a saved Action, or customer-managed credentials supplied in the request, but never returns credential values.",
        "tags": [
          "Action options"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionOptionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Provider-specific Action options page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionOptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported provider, resource, auth mode, or dependency input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Dashboard authentication is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership is required; project API keys are not accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Saved Action was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Connected account or credentials are unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Provider-specific option input is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Provider rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Provider options request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/requests": {
      "get": {
        "operationId": "getRequestMetrics",
        "summary": "Query request metrics",
        "description": "Returns a zero-filled time series for the requested request measures. Measures supports count, accepted_count, and rejected_count.",
        "tags": [
          "Metrics"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "measures",
            "in": "query",
            "required": true,
            "description": "Required comma-separated measures: count, accepted_count, rejected_count.",
            "schema": {
              "$ref": "#/components/schemas/MetricsMeasures"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Range start; defaults to the configured metrics window.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Range end; defaults to now.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "description": "Time-series bucket size.",
            "schema": {
              "$ref": "#/components/schemas/MetricsGranularity"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Limit metrics to one Source.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "batch_operation_id",
            "in": "query",
            "description": "Limit metrics to one bulk operation.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Limit metrics by request acceptance status.",
            "schema": {
              "$ref": "#/components/schemas/RequestMetricStatus"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search request identifiers and indexed metadata.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request metrics time series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestMetricsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, granularity, measures, or status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Metrics query failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/events": {
      "get": {
        "operationId": "getEventMetrics",
        "summary": "Query event metrics",
        "description": "Returns a zero-filled event time series. Supported measures are count, delivered_count, failed_count, queued_count, processing_count, hold_count, and ignored_count.",
        "tags": [
          "Metrics"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "measures",
            "in": "query",
            "required": true,
            "description": "Required comma-separated event measures.",
            "schema": {
              "$ref": "#/components/schemas/MetricsMeasures"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Range start; defaults to the configured metrics window.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Range end; defaults to now.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "description": "Time-series bucket size.",
            "schema": {
              "$ref": "#/components/schemas/MetricsGranularity"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Limit metrics to one Source.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Comma-separated Connection identifiers.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "description": "Comma-separated Destination identifiers.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "batch_operation_id",
            "in": "query",
            "description": "Limit metrics to one bulk operation.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "batch_operation_scope",
            "in": "query",
            "description": "Bulk operation target scope.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Limit metrics by event status.",
            "schema": {
              "$ref": "#/components/schemas/EventMetricStatus"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search event identifiers and indexed metadata.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event metrics time series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventMetricsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, granularity, measures, or status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Metrics query failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/sources": {
      "get": {
        "operationId": "listSourceMetrics",
        "summary": "List Source metrics",
        "description": "Returns six-bin 24-hour request metrics and Connection counts for the requested Source IDs.",
        "tags": [
          "Metrics"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "id",
            "in": "query",
            "description": "Comma-separated Source IDs; may be repeated. Aliases source_id, source_ids, and ids are also accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source metric models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceMetricsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/connections": {
      "get": {
        "operationId": "listConnectionMetrics",
        "summary": "List Connection metrics",
        "description": "Returns six-bin 24-hour Event metrics for the requested Connection IDs.",
        "tags": [
          "Metrics"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "id",
            "in": "query",
            "description": "Comma-separated Connection IDs; may be repeated. Connection and webhook aliases are also accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection metric models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionMetricsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/destinations": {
      "get": {
        "operationId": "listDestinationMetrics",
        "summary": "List Destination metrics",
        "description": "Returns six-bin 24-hour Attempt metrics plus partial-result provenance for the requested Destination IDs.",
        "tags": [
          "Metrics"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "id",
            "in": "query",
            "description": "Comma-separated Destination IDs; may be repeated. Aliases destination_id, destination_ids, and ids are also accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Destination metric models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationMetricsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/transformations": {
      "get": {
        "operationId": "listTransformationMetrics",
        "summary": "List Transformation metrics",
        "description": "Returns six-bin 24-hour execution metrics, error counts, and Connection counts for the requested Transformation IDs.",
        "tags": [
          "Metrics"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "id",
            "in": "query",
            "description": "Comma-separated Transformation IDs; may be repeated. Transformation aliases are also accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transformation metric models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransformationMetricsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests": {
      "get": {
        "operationId": "listRequests",
        "summary": "List requests",
        "description": "Returns a descending cursor page of inbound Requests. Totals are lower bounds while next_cursor is present, and partial identifies unavailable Event D1 shards.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Range start; defaults to the configured request window.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Range end; defaults to now.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size; default and maximum are 100.",
            "schema": {
              "$ref": "#/components/schemas/RequestListLimit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque next_cursor. The next and prev aliases are accepted by the server.",
            "schema": {
              "$ref": "#/components/schemas/RequestCursor"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Acceptance status.",
            "schema": {
              "$ref": "#/components/schemas/RequestMetricStatus"
            }
          },
          {
            "name": "verified",
            "in": "query",
            "description": "Signature verification filter.",
            "schema": {
              "$ref": "#/components/schemas/QueryBoolean"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Exact Source filter.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Exact Connection filter.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          },
          {
            "name": "batch_operation_id",
            "in": "query",
            "description": "Exact bulk-operation filter.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          },
          {
            "name": "is_retry",
            "in": "query",
            "description": "Retry lineage filter.",
            "schema": {
              "$ref": "#/components/schemas/QueryBoolean"
            }
          },
          {
            "name": "retry_kind",
            "in": "query",
            "description": "Retry kind filter.",
            "schema": {
              "$ref": "#/components/schemas/RequestRetryKind"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search Request and external identifiers; search_term is an alias.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "include",
            "in": "query",
            "description": "Optional comma-separated data and event_summary expansions; may be repeated.",
            "schema": {
              "$ref": "#/components/schemas/RequestInclude"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cursor page of Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, cursor, status, or boolean filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/count": {
      "get": {
        "operationId": "countRequests",
        "summary": "Count requests",
        "description": "Counts Requests with the same filters as listRequests and reports partial shard availability explicitly.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Range start; defaults to the configured request window.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Range end; defaults to now.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Acceptance status.",
            "schema": {
              "$ref": "#/components/schemas/RequestMetricStatus"
            }
          },
          {
            "name": "verified",
            "in": "query",
            "description": "Signature verification filter.",
            "schema": {
              "$ref": "#/components/schemas/QueryBoolean"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Exact Source filter.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Exact Connection filter.",
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          },
          {
            "name": "batch_operation_id",
            "in": "query",
            "description": "Exact bulk-operation filter.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          },
          {
            "name": "is_retry",
            "in": "query",
            "description": "Retry lineage filter.",
            "schema": {
              "$ref": "#/components/schemas/QueryBoolean"
            }
          },
          {
            "name": "retry_kind",
            "in": "query",
            "description": "Retry kind filter.",
            "schema": {
              "$ref": "#/components/schemas/RequestRetryKind"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search Request and external identifiers; search_term is an alias.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request count with shard completeness",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestCountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, status, or boolean filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{requestId}": {
      "get": {
        "operationId": "retrieveRequest",
        "summary": "Retrieve a request",
        "description": "Returns one Request with its stored inbound payload and most recent proxy exchange when available.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Stable req_* Request identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{requestId}/trace": {
      "get": {
        "operationId": "retrieveRequestTrace",
        "summary": "Retrieve a request trace",
        "description": "Returns the complete Request path: dynamic inbound payload, proxy exchange, Events, ignored branches, Attempts, Transformation executions, grouped indexes, and a sorted timeline.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Stable req_* Request identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Composite Request trace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestTraceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{requestId}/events": {
      "get": {
        "operationId": "listRequestEvents",
        "summary": "List request Events",
        "description": "Returns delivery Events produced for one Request. CANCELLED Events are excluded unless an explicit status filter includes them.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Stable req_* Request identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results; default 100 and maximum 255.",
            "schema": {
              "$ref": "#/components/schemas/ControlListLimit"
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "Comma-separated Event IDs; may be repeated.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Comma-separated Connection IDs; webhook_id aliases are accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "description": "Comma-separated Destination IDs.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Comma-separated Source IDs.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Comma-separated Event statuses; may be repeated.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request Event list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestEventListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Event status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{requestId}/ignored_events": {
      "get": {
        "operationId": "listIgnoredRequestEvents",
        "summary": "List ignored request Events",
        "description": "Returns CANCELLED connection-level branches for one Request as stable composite ignored-Event models.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Stable req_* Request identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results; default 100 and maximum 255.",
            "schema": {
              "$ref": "#/components/schemas/ControlListLimit"
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "Comma-separated composite ignored-Event IDs; may be repeated.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Comma-separated Connection IDs; webhook_id aliases are accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ignored Request Event list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IgnoredRequestEventListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/bulk_operations": {
      "get": {
        "operationId": "listRequestBulkOperations",
        "summary": "List Request bulk operations",
        "description": "Lists Request bulk-retry operations with durable item counts and cancellation availability.",
        "tags": [
          "Request bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "bucket",
            "in": "query",
            "description": "all, ongoing, or terminal history; defaults to all.",
            "schema": {
              "$ref": "#/components/schemas/RequestBulkOperationBucket"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results; default 100 and maximum 255.",
            "schema": {
              "$ref": "#/components/schemas/ControlListLimit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request bulk-operation list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestBulkOperationListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createRequestBulkOperation",
        "summary": "Create a Request bulk retry",
        "description": "Creates a durable bulk-retry operation for Requests matching the supplied bounded filters.",
        "tags": [
          "Request bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBulkOperationCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Request bulk operation created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestBulkOperationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter or time range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:execute grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Bulk-operation item publication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List Events",
        "description": "Returns an exact-total descending cursor page across Event D1 shards.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Range start; defaults to the configured Event window unless a bulk operation is selected.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Range end; defaults to now unless a bulk operation is selected.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size; default and maximum are 100.",
            "schema": {
              "$ref": "#/components/schemas/RequestListLimit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque next_cursor; next and prev aliases are accepted.",
            "schema": {
              "$ref": "#/components/schemas/RequestCursor"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Delivery status filter.",
            "schema": {
              "$ref": "#/components/schemas/EventMetricStatus"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Exact Source filter.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Comma-separated Connection IDs; webhook_id aliases are accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "description": "Comma-separated Destination IDs.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "batch_operation_id",
            "in": "query",
            "description": "Exact Event bulk-operation filter.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          },
          {
            "name": "batch_operation_scope",
            "in": "query",
            "description": "Select retry, target, or related Event membership.",
            "schema": {
              "$ref": "#/components/schemas/EventBatchOperationScope"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search Event, Request, Connection, Source, Destination, payload, and failure identifiers; search_term is an alias.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cursor page of Events",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, cursor, or status filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/count": {
      "get": {
        "operationId": "countEvents",
        "summary": "Count Events",
        "description": "Counts Events with the same filters as listEvents.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Range start; defaults to the configured Event window unless a bulk operation is selected.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Range end; defaults to now unless a bulk operation is selected.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Delivery status filter.",
            "schema": {
              "$ref": "#/components/schemas/EventMetricStatus"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Exact Source filter.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Comma-separated Connection IDs; webhook_id aliases are accepted.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "description": "Comma-separated Destination IDs.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "batch_operation_id",
            "in": "query",
            "description": "Exact Event bulk-operation filter.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          },
          {
            "name": "batch_operation_scope",
            "in": "query",
            "description": "Select retry, target, or related Event membership.",
            "schema": {
              "$ref": "#/components/schemas/EventBatchOperationScope"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search Event, Request, Connection, Source, Destination, payload, and failure identifiers; search_term is an alias.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact Event count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range or status filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/{eventId}": {
      "get": {
        "operationId": "retrieveEvent",
        "summary": "Retrieve an Event",
        "description": "Returns one Event with its stored dynamic payload when available.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Stable evt_* Event identifier.",
            "schema": {
              "$ref": "#/components/schemas/EventId"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "description": "Optional Request ID routing hint returned by Event models. A valid hint avoids a cross-shard lookup; an absent or stale hint preserves the normal fallback lookup.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/attempts": {
      "get": {
        "operationId": "listAttempts",
        "summary": "List delivery Attempts",
        "description": "Returns a bounded bidirectional cursor page of delivery Attempts across Event D1 shards.",
        "tags": [
          "Attempts"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "order_by",
            "in": "query",
            "description": "Sort field; defaults to created_at.",
            "schema": {
              "$ref": "#/components/schemas/AttemptOrderBy"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "description": "Sort direction; defaults to desc.",
            "schema": {
              "$ref": "#/components/schemas/AttemptDirection"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Attempt outcome filter.",
            "schema": {
              "$ref": "#/components/schemas/AttemptStatus"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Optional range start.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Optional range end.",
            "schema": {
              "$ref": "#/components/schemas/MetricsTimeExpression"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results; default 100 and maximum 255.",
            "schema": {
              "$ref": "#/components/schemas/ControlListLimit"
            }
          },
          {
            "name": "event_id",
            "in": "query",
            "description": "Comma-separated Event IDs; may be repeated.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "description": "Comma-separated Destination IDs; may be repeated.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search Attempt, Event, Request, Destination, error, and URL fields; search_term is an alias.",
            "schema": {
              "$ref": "#/components/schemas/MetricsResourceIds"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque forward cursor; next is an alias.",
            "schema": {
              "$ref": "#/components/schemas/RequestCursor"
            }
          },
          {
            "name": "prev",
            "in": "query",
            "description": "Opaque reverse cursor.",
            "schema": {
              "$ref": "#/components/schemas/RequestCursor"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "description": "Optional exact Request ID filter that routes the lookup directly to the owning Event shard. Empty filtered pages stop on that shard when the Request exists; absent or legacy placement retains the fallback lookup.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cursor page of Attempts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttemptListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, cursor, status, order, or direction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/attempts/{attemptId}": {
      "get": {
        "operationId": "retrieveAttempt",
        "summary": "Retrieve a delivery Attempt",
        "description": "Returns one delivery Attempt, including its dynamic response body.",
        "tags": [
          "Attempts"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "description": "Stable att_* Attempt identifier.",
            "schema": {
              "$ref": "#/components/schemas/AttemptId"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "description": "Optional Request ID routing hint returned by Attempt models. A valid hint avoids a cross-shard lookup; an absent or stale hint preserves the normal fallback lookup.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attempt detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttemptModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Attempt not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/bulk_operations": {
      "get": {
        "operationId": "listEventBulkOperations",
        "summary": "List Event bulk operations",
        "description": "Lists Event bulk-retry operations with durable item counts and cancellation availability.",
        "tags": [
          "Event bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "bucket",
            "in": "query",
            "description": "all, ongoing, or terminal history; defaults to all.",
            "schema": {
              "$ref": "#/components/schemas/RequestBulkOperationBucket"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results; default 100 and maximum 255.",
            "schema": {
              "$ref": "#/components/schemas/ControlListLimit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event bulk-operation list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventBulkOperationListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createEventBulkOperation",
        "summary": "Create an Event bulk retry",
        "description": "Creates a durable bulk-retry operation for Events matching the supplied bounded filters.",
        "tags": [
          "Event bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventBulkOperationCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Event bulk operation created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventBulkOperationModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter or time range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:execute grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Bulk-operation item publication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/bulk_operations/{operationId}": {
      "get": {
        "operationId": "retrieveEventBulkOperation",
        "summary": "Retrieve an Event bulk operation",
        "description": "Returns one Event bulk-retry operation with durable item counts.",
        "tags": [
          "Event bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "description": "Stable bch_* bulk-operation identifier.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event bulk-operation detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventBulkOperationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:read scope is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Bulk operation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/bulk_operations/{operationId}/cancel": {
      "post": {
        "operationId": "cancelRequestBulkOperation",
        "summary": "Cancel a Request bulk retry",
        "description": "Atomically cancels a planned or running Request bulk-retry operation.",
        "tags": [
          "Request bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "description": "Stable bch_* bulk-operation identifier.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request bulk operation cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestBulkOperationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team owner or site administrator access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Bulk operation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Resource state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{requestId}/retry": {
      "post": {
        "operationId": "retryRequest",
        "summary": "Retry a Request",
        "description": "Queues an exact replay or a replay with explicitly supplied method, path, query, header, or body modifications.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Stable req_* Request identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestRetryRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request retry queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestRetryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid replay modifications",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:execute grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Resource state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Modified replay body is too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Request retry could not be queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{requestId}/share": {
      "post": {
        "operationId": "createRequestShare",
        "summary": "Create a sanitized Request share",
        "description": "Creates an expiring immutable Request snapshot with default secret redaction and optional custom redaction keys.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Stable req_* Request identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRequestShareRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sanitized Request share created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestShareModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid share expiration or TTL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team owner or site administrator access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/bulk_operations/{operationId}/cancel": {
      "post": {
        "operationId": "cancelEventBulkOperation",
        "summary": "Cancel an Event bulk retry",
        "description": "Atomically cancels a planned or running Event bulk-retry operation.",
        "tags": [
          "Event bulk operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "description": "Stable bch_* bulk-operation identifier.",
            "schema": {
              "$ref": "#/components/schemas/BatchOperationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event bulk operation cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventBulkOperationModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team owner or site administrator access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Bulk operation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Resource state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/{eventId}/retry": {
      "post": {
        "operationId": "retryEvent",
        "summary": "Retry an Event",
        "description": "Queues a new delivery Event from the original send-ready Event payload.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Stable evt_* Event identifier.",
            "schema": {
              "$ref": "#/components/schemas/EventId"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "description": "Optional Request ID routing hint returned by Event models. A valid hint avoids a cross-shard lookup; an absent or stale hint preserves the normal fallback lookup.",
            "schema": {
              "$ref": "#/components/schemas/RequestId"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Event retry queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventRetryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or control:execute grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Resource state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Event retry could not be queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/channel-alerts": {
      "get": {
        "operationId": "listSourceChannelAlerts",
        "summary": "List Source channel alerts",
        "description": "Lists bounded active, resolved, or all provider Source channel alerts newest first.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Alert state; defaults to active.",
            "schema": {
              "$ref": "#/components/schemas/SourceChannelAlertStatus"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results; defaults to 50.",
            "schema": {
              "$ref": "#/components/schemas/SourceOperationalLimit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source channel alerts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelAlertListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/channel-metrics": {
      "get": {
        "operationId": "listSourceChannelMetrics",
        "summary": "List Source channel metrics",
        "description": "Returns daily aggregated channel lifecycle, notification, fallback, and alert metrics.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "days",
            "in": "query",
            "description": "Lookback days; defaults to 14.",
            "schema": {
              "$ref": "#/components/schemas/SourceChannelMetricDays"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source channel metrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelMetricsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/channels": {
      "get": {
        "operationId": "listSourceChannels",
        "summary": "List instant Source channels",
        "description": "Lists up to 250 instant-delivery provider Sources with their channel health summaries.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Optional channel-health filter.",
            "schema": {
              "$ref": "#/components/schemas/SourceChannelStatus"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source channels",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/channels/bulk": {
      "post": {
        "operationId": "bulkUpdateSourceChannels",
        "summary": "Bulk update Source channels",
        "description": "Retries or changes delivery mode for up to 100 selected provider Sources, sequentially and without concurrent fan-in.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkSourceChannelsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk Source channel result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSourceChannelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid source selection or action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team owner or site administrator access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/channel-settings": {
      "get": {
        "operationId": "getSourceChannelSettings",
        "summary": "Get Source channel alert settings",
        "description": "Returns team-level email and Slack notification settings without returning the Slack webhook credential.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Source channel settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelSettings"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateSourceChannelSettings",
        "summary": "Update Source channel alert settings",
        "description": "Updates team-level alert delivery settings; stored Slack credentials are encrypted and never returned.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSourceChannelSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Source channel settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Slack webhook or settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team owner or site administrator access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/run": {
      "post": {
        "operationId": "runSourceNow",
        "summary": "Run a polling Source now",
        "description": "Creates a durable manual Source run and queues it on the Source activity queue.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Source run queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceRunQueuedResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or the exact control:execute grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source type or state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Source runner is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/channel-retry": {
      "post": {
        "operationId": "retrySourceChannel",
        "summary": "Retry an instant Source channel",
        "description": "Prioritizes channel reprovisioning for an enabled instant Source with a connected provider account.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Source channel retry requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelRetryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team access or the exact control:execute grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source type or state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/channel-events": {
      "get": {
        "operationId": "listSourceChannelEvents",
        "summary": "List Source channel diagnostics",
        "description": "Returns bounded channel lifecycle events, current channel records, and alert-delivery history for one provider Source.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum lifecycle events; defaults to 100.",
            "schema": {
              "$ref": "#/components/schemas/SourceChannelEventLimit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source channel diagnostics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceChannelEventsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/delivery": {
      "patch": {
        "operationId": "updateSourceDelivery",
        "summary": "Update Source delivery mode",
        "description": "Switches a supported provider Source between instant and polling delivery and returns the canonical Source projection.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSourceDeliveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid delivery mode",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team owner or site administrator access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source type or state does not permit this operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/runs": {
      "get": {
        "operationId": "listSourceRuns",
        "summary": "List Source runs",
        "description": "Lists bounded polling Source runs with cursor transitions and item records.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum runs; defaults to 25.",
            "schema": {
              "$ref": "#/components/schemas/SourceOperationalLimit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source runs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceActivityListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sources/{sourceId}/activity": {
      "get": {
        "operationId": "listSourceActivity",
        "summary": "List provider Source activity",
        "description": "Lists bounded provider-webhook activity normalized to the common Source-run timeline.",
        "tags": [
          "Source operations"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Stable src_* Source identifier.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum activity records; defaults to 25.",
            "schema": {
              "$ref": "#/components/schemas/SourceOperationalLimit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provider Source activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceActivityListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team-member session access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provider Source not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/request-fixtures": {
      "get": {
        "operationId": "listRequestFixtures",
        "summary": "List Request Fixtures",
        "description": "Lists saved Request payload fixtures without exposing team or R2 storage metadata.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Request Fixtures",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestFixtureListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createRequestFixture",
        "summary": "Create a Request Fixture",
        "description": "Copies an available Request payload into durable fixture storage for later replay.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRequestFixtureRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created Request Fixture",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestFixtureModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source payload or replay target is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/request-fixtures/{fixtureId}": {
      "get": {
        "operationId": "retrieveRequestFixture",
        "summary": "Retrieve a Request Fixture",
        "description": "Returns one saved fixture without exposing its team or R2 storage metadata.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fixtureId",
            "in": "path",
            "required": true,
            "description": "Stable fix_* Request Fixture identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestFixtureId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request Fixture",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestFixtureModel"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchRequestFixture",
        "summary": "Patch a Request Fixture",
        "description": "Updates the fixture name or description while retaining the saved payload.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fixtureId",
            "in": "path",
            "required": true,
            "description": "Stable fix_* Request Fixture identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestFixtureId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRequestFixtureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Request Fixture",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestFixtureModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRequestFixture",
        "summary": "Update a Request Fixture",
        "description": "Applies the same partial name and description semantics as PATCH for compatibility.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fixtureId",
            "in": "path",
            "required": true,
            "description": "Stable fix_* Request Fixture identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestFixtureId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRequestFixtureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Request Fixture",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestFixtureModel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRequestFixture",
        "summary": "Delete a Request Fixture",
        "description": "Deletes the authoritative fixture row and best-effort removes its stored payload object.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fixtureId",
            "in": "path",
            "required": true,
            "description": "Stable fix_* Request Fixture identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestFixtureId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted Request Fixture",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteRequestFixtureResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/request-fixtures/{fixtureId}/targets": {
      "get": {
        "operationId": "listRequestFixtureTargets",
        "summary": "List Request Fixture replay targets",
        "description": "Lists active Connection and Destination targets eligible for fixture replay.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fixtureId",
            "in": "path",
            "required": true,
            "description": "Stable fix_* Request Fixture identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestFixtureId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request Fixture replay targets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestFixtureTargetsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/request-fixtures/{fixtureId}/replay": {
      "post": {
        "operationId": "replayRequestFixture",
        "summary": "Replay a Request Fixture",
        "description": "Queues the saved payload for one active Connection using the exact fixture replay execute grant.",
        "tags": [
          "Request Fixtures"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fixtureId",
            "in": "path",
            "required": true,
            "description": "Stable fix_* Request Fixture identifier.",
            "schema": {
              "$ref": "#/components/schemas/RequestFixtureId"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayRequestFixtureRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request Fixture replay queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayRequestFixtureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Required team access or project-key grant is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request Fixture or source Request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Source payload or replay target is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Fixture replay queue is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shares/request/{token}": {
      "get": {
        "operationId": "retrievePublicRequestShare",
        "summary": "Retrieve a public request share",
        "description": "Retrieves the sanitized request snapshot addressed by a public capability token.",
        "tags": [
          "Public request shares"
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "Public request-share capability token.",
            "schema": {
              "$ref": "#/components/schemas/PublicRequestShareToken"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized shared request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestShareModel"
                }
              }
            }
          },
          "404": {
            "description": "Share not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Share revoked or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-templates": {
      "get": {
        "operationId": "listWorkflowTemplates",
        "summary": "List published Workflow Templates",
        "description": "Lists published Workflow Template metadata for the public catalog.",
        "tags": [
          "Workflow Templates"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Published Workflow Templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateListResponse"
                }
              }
            }
          },
          "500": {
            "description": "Template catalog could not be loaded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-templates/{templateKey}": {
      "get": {
        "operationId": "retrieveWorkflowTemplate",
        "summary": "Retrieve a published Workflow Template",
        "description": "Retrieves published Workflow Template metadata by key.",
        "tags": [
          "Workflow Templates"
        ],
        "security": [],
        "parameters": [
          {
            "name": "templateKey",
            "in": "path",
            "required": true,
            "description": "Workflow Template key.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowTemplateKey"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published Workflow Template.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateModel"
                }
              }
            }
          },
          "404": {
            "description": "Workflow Template not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-templates/{templateKey}/instantiate": {
      "post": {
        "operationId": "instantiateWorkflowTemplate",
        "summary": "Create a Workflow from a template",
        "description": "Creates a draft Workflow from a published template. Requires a project owner session.",
        "tags": [
          "Workflow Templates"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_owner_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "templateKey",
            "in": "path",
            "required": true,
            "description": "Workflow Template key.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowTemplateKey"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstantiateWorkflowTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created draft Workflow and source template metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantiateWorkflowTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name or template graph.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Project owner role required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow Template not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Workflow name conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Template contains an invalid action or graph.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-activity": {
      "get": {
        "operationId": "listWorkflowActivity",
        "summary": "List Workflow activity",
        "description": "Lists recent Workflow runs across the selected project, including compact Step results.",
        "tags": [
          "Workflow activity"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_read",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum runs to return.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowActivityLimit"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive start time as ISO date-time or now-relative expression.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowActivityTime"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Inclusive end time as ISO date-time or now-relative expression.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowActivityTime"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "Filter by Source ID.",
            "schema": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search request ID, Workflow name, or Source name.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowActivityQuery"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by Workflow run status.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowActivityStatus"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow activity page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowActivityListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid time range or status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Project access or control:read scope required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/runs/{runId}/iterations": {
      "get": {
        "operationId": "retrieveWorkflowLoopIterations",
        "summary": "Read paged Loop iterations",
        "description": "Search redacted saved iteration summaries independently from the audit preview size limit.",
        "tags": [
          "Workflows"
        ],
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "Stable wfl_* Workflow identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowId"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "Workflow or Trigger-run identifier.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowRunId"
            }
          },
          {
            "name": "step_id",
            "in": "query",
            "required": true,
            "description": "Selected Loop step id.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQueryStepId"
            }
          },
          {
            "name": "iteration_path",
            "in": "query",
            "description": "JSON array of ancestor indexes; [] for a top-level Loop.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQueryIterationPath"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "all, failed, succeeded, or filtered.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQueryStatus"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search redacted summaries.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQuerySearch"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Zero-based page offset.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQueryOffset"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size up to50.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQueryLimit"
            }
          },
          {
            "name": "index",
            "in": "query",
            "description": "Center page on this iteration index after filtering.",
            "schema": {
              "$ref": "#/components/schemas/WorkflowIterationQueryIndex"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged iteration summaries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowLoopIterations"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Team membership or site-admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workflow or run not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflow-aggregate/test": {
      "post": {
        "operationId": "testWorkflowAggregate",
        "summary": "Test a Workflow Aggregate configuration",
        "description": "Aggregate a complete saved Loop result using the runtime engine. Does not execute steps or save data. Request body is limited to 16 MiB.",
        "tags": [
          "Workflow Aggregate"
        ],
        "security": [
          {
            "SessionBearer": []
          },
          {
            "ProjectApiKeyBearer": []
          }
        ],
        "x-fasthook-required-role": "team_member_or_site_admin_or_project_api_key_execute",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowAggregateTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Aggregate output and inclusion counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowAggregateTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON request envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Execute permission or the exact project-key grant is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Aggregate request exceeds 16 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Aggregate config or source output is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowAggregateErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SessionBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Dashboard session bearer token. Project API keys cannot manage project API keys."
      },
      "ProjectApiKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fhp_*",
        "description": "Project API key. Only operations declaring this security scheme accept it, subject to scopes and exact execute grants."
      }
    },
    "parameters": {
      "TeamId": {
        "name": "x-team-id",
        "in": "header",
        "required": false,
        "description": "Team selected for the operation. The authenticated subject must have the role declared by the operation.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "ProjectApiKeyId": {
        "type": "string",
        "pattern": "^pak_(?:[0-9a-f]{32}|legacy_[0-9a-f]{32})$"
      },
      "ProjectApiKeyScope": {
        "type": "string",
        "enum": [
          "control:read",
          "control:execute",
          "tunnel:connect"
        ]
      },
      "ProjectApiKeyExecuteGrant": {
        "type": "string",
        "enum": [
          "POST:/v1/sources/:id/run",
          "POST:/v1/sources/:id/channel-retry",
          "PUT:/v1/transformations/validate",
          "PUT:/v1/transformations/run",
          "POST:/v1/filters/test",
          "POST:/v1/workflow-formatter/test",
          "POST:/v1/workflow-aggregate/test",
          "POST:/v1/workflows/:id/test-trigger",
          "POST:/v1/workflows/:id/test-action",
          "POST:/v1/workflows/:id/test-loop-step",
          "POST:/v1/requests/bulk_operations",
          "POST:/v1/requests/:id/retry",
          "POST:/v1/events/bulk_operations",
          "POST:/v1/events/:id/retry",
          "POST:/v1/request-fixtures/:id/replay",
          "POST:/v1/workflows/:id/runs/:executionId/retry"
        ]
      },
      "ProjectApiKeyStatus": {
        "type": "string",
        "enum": [
          "active",
          "disabled",
          "revoked"
        ]
      },
      "MutableProjectApiKeyStatus": {
        "type": "string",
        "enum": [
          "active",
          "disabled"
        ]
      },
      "ProjectApiKey": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "name",
          "masked_key",
          "status",
          "scopes",
          "execute_grants",
          "rate_limit_per_minute",
          "legacy_project_secret",
          "created_by_user_id",
          "last_used_at",
          "secret_last_rotated_at",
          "revoked_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProjectApiKeyId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "masked_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "$ref": "#/components/schemas/ProjectApiKeyStatus"
          },
          "scopes": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyScope"
            }
          },
          "execute_grants": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 11,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyExecuteGrant"
            }
          },
          "rate_limit_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "legacy_project_secret": {
            "type": "boolean"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "secret_last_rotated_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectApiKeyWithSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "name",
          "masked_key",
          "status",
          "scopes",
          "execute_grants",
          "rate_limit_per_minute",
          "legacy_project_secret",
          "created_by_user_id",
          "last_used_at",
          "secret_last_rotated_at",
          "revoked_at",
          "created_at",
          "updated_at",
          "api_key"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProjectApiKeyId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "masked_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "$ref": "#/components/schemas/ProjectApiKeyStatus"
          },
          "scopes": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyScope"
            }
          },
          "execute_grants": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 11,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyExecuteGrant"
            }
          },
          "rate_limit_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "legacy_project_secret": {
            "type": "boolean"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "secret_last_rotated_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "api_key": {
            "type": "string",
            "pattern": "^fhp_[0-9a-f]{64}$",
            "description": "Returned only by createProjectApiKey. Store it immediately; it cannot be retrieved later."
          }
        }
      },
      "ProjectApiKeyResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ProjectApiKey"
          }
        }
      },
      "CreateProjectApiKeyResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ProjectApiKeyWithSecret"
          }
        }
      },
      "ProjectApiKeyListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKey"
            }
          }
        }
      },
      "CreateProjectApiKeyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "scopes"
        ],
        "allOf": [
          {
            "if": {
              "type": "object",
              "required": [
                "execute_grants"
              ],
              "properties": {
                "execute_grants": {
                  "type": "array",
                  "minItems": 1
                }
              }
            },
            "then": {
              "type": "object",
              "properties": {
                "scopes": {
                  "type": "array",
                  "contains": {
                    "const": "control:execute"
                  }
                }
              }
            }
          }
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "\\S"
          },
          "scopes": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyScope"
            }
          },
          "execute_grants": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 11,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyExecuteGrant"
            }
          },
          "rate_limit_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          }
        }
      },
      "UpdateProjectApiKeyRequest": {
        "type": "object",
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "type": "object",
              "required": [
                "execute_grants"
              ],
              "properties": {
                "execute_grants": {
                  "type": "array",
                  "minItems": 1
                }
              }
            },
            "then": {
              "type": "object",
              "anyOf": [
                {
                  "type": "object",
                  "not": {
                    "type": "object",
                    "required": [
                      "scopes"
                    ],
                    "properties": {
                      "scopes": {}
                    }
                  }
                },
                {
                  "type": "object",
                  "properties": {
                    "scopes": {
                      "type": "array",
                      "contains": {
                        "const": "control:execute"
                      }
                    }
                  }
                }
              ]
            }
          }
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "\\S"
          },
          "status": {
            "$ref": "#/components/schemas/MutableProjectApiKeyStatus"
          },
          "scopes": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyScope"
            }
          },
          "execute_grants": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 11,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyExecuteGrant"
            }
          },
          "rate_limit_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          }
        }
      },
      "ProjectApiKeyAuditDecision": {
        "type": "string",
        "enum": [
          "allowed",
          "denied",
          "rate_limited"
        ]
      },
      "ProjectApiKeyAuditEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "key_id",
          "team_id",
          "route_key",
          "permission",
          "decision",
          "reason",
          "cf_ray",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "key_id": {
            "$ref": "#/components/schemas/ProjectApiKeyId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "route_key": {
            "type": "string",
            "maxLength": 96
          },
          "permission": {
            "type": "string",
            "enum": [
              "read",
              "edit",
              "rotate-secret",
              "execute",
              "tunnel-connect"
            ]
          },
          "decision": {
            "$ref": "#/components/schemas/ProjectApiKeyAuditDecision"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "cf_ray": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectApiKeyAuditListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ProjectApiKeyAuditEntry"
            }
          }
        }
      },
      "JsonValue": {
        "anyOf": [
          {
            "type": "null"
          },
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        ]
      },
      "NonNullJsonValue": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        ]
      },
      "FilterConditions": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "headers": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "body": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "query": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "path": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          }
        }
      },
      "FilterTestInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "headers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "query": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "path": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "FilterTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "filter"
        ],
        "properties": {
          "filter": {
            "$ref": "#/components/schemas/FilterConditions"
          },
          "input": {
            "$ref": "#/components/schemas/FilterTestInput"
          }
        }
      },
      "FilterTestResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "matched"
        ],
        "properties": {
          "matched": {
            "type": "boolean"
          }
        }
      },
      "WorkflowFormatterMappingField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "target",
          "kind"
        ],
        "properties": {
          "target": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "kind": {
            "type": "string",
            "enum": [
              "field",
              "constant",
              "template"
            ]
          },
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "value": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "WorkflowFormatterMapping": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "passthrough",
          "fields"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "passthrough": {
            "type": "boolean",
            "const": false
          },
          "fields": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/WorkflowFormatterMappingField"
            }
          }
        }
      },
      "WorkflowFormatterConfig": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "engine",
          "version",
          "category",
          "transform",
          "mapping"
        ],
        "properties": {
          "loop_id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "engine": {
            "type": "string",
            "const": "formatter"
          },
          "version": {
            "type": "integer",
            "const": 1
          },
          "category": {
            "type": "string",
            "enum": [
              "date_time",
              "number",
              "text",
              "utilities"
            ]
          },
          "transform": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "mapping": {
            "$ref": "#/components/schemas/WorkflowFormatterMapping"
          }
        }
      },
      "WorkflowFormatterSampleContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "anchor_timestamp"
        ],
        "properties": {
          "input": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "loop": {
            "type": "object",
            "additionalProperties": true
          },
          "trigger": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "steps": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "anchor_timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkflowFormatterTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "config",
          "sample_context"
        ],
        "properties": {
          "config": {
            "$ref": "#/components/schemas/WorkflowFormatterConfig"
          },
          "sample_context": {
            "$ref": "#/components/schemas/WorkflowFormatterSampleContext"
          }
        }
      },
      "WorkflowFormatterChoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value",
          "label"
        ],
        "properties": {
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "WorkflowFormatterField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "label",
          "required",
          "type",
          "supports_mapping"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean",
              "enum",
              "json",
              "line_items",
              "timezone",
              "date_format"
            ]
          },
          "supports_mapping": {
            "type": "boolean",
            "const": true
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowFormatterChoice"
            }
          },
          "default": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "placeholder": {
            "type": "string"
          }
        }
      },
      "WorkflowFormatterOperation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "category",
          "label",
          "description",
          "line_item_policy",
          "fields",
          "output_schema"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "date_time",
              "number",
              "text",
              "utilities"
            ]
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "line_item_policy": {
            "type": "string",
            "enum": [
              "map",
              "native",
              "unsupported"
            ]
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowFormatterField"
            }
          },
          "output_schema": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "WorkflowFormatterCategory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "description",
          "operations"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "date_time",
              "number",
              "text",
              "utilities"
            ]
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowFormatterOperation"
            }
          }
        }
      },
      "WorkflowFormatterCatalogResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "engine",
          "version",
          "limits",
          "categories"
        ],
        "properties": {
          "engine": {
            "type": "string",
            "const": "formatter"
          },
          "version": {
            "type": "integer",
            "const": 1
          },
          "limits": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "resolved_input_bytes",
              "output_bytes",
              "string_code_points",
              "line_items",
              "lookup_rows"
            ],
            "properties": {
              "resolved_input_bytes": {
                "type": "integer",
                "minimum": 1
              },
              "output_bytes": {
                "type": "integer",
                "minimum": 1
              },
              "string_code_points": {
                "type": "integer",
                "minimum": 1
              },
              "line_items": {
                "type": "integer",
                "minimum": 1
              },
              "lookup_rows": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowFormatterCategory"
            }
          }
        }
      },
      "WorkflowFormatterTestResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data_in",
          "data_out",
          "output_schema",
          "warnings"
        ],
        "properties": {
          "data_in": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "data_out": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "output_schema": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WorkflowFormatterErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "field": {
                "type": "string"
              }
            }
          }
        }
      },
      "FilterId": {
        "type": "string",
        "minLength": 1
      },
      "StoredFilterConditions": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "headers": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "body": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "query": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "path": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          }
        }
      },
      "FilterModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "name",
          "conditions",
          "connections_count",
          "sample_connection_id",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/FilterId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "conditions": {
            "$ref": "#/components/schemas/StoredFilterConditions"
          },
          "headers": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "body": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "query": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "path": {
            "$ref": "#/components/schemas/NonNullJsonValue"
          },
          "connections_count": {
            "type": "integer",
            "minimum": 0
          },
          "sample_connection_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FilterPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at",
              "updated_at",
              "name"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 255
          }
        }
      },
      "FilterListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/FilterPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "models": {
            "type": "array",
            "maxItems": 255,
            "items": {
              "$ref": "#/components/schemas/FilterModel"
            }
          }
        }
      },
      "CreateFilterRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "conditions"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "conditions": {
            "$ref": "#/components/schemas/FilterConditions"
          }
        }
      },
      "UpdateFilterRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "conditions": {
            "$ref": "#/components/schemas/FilterConditions"
          }
        }
      },
      "DeleteFilterResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/FilterId"
          }
        }
      },
      "FilterAlreadyExistsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "const": "RESOURCE_ALREADY_EXISTS"
          },
          "status": {
            "type": "integer",
            "const": 409
          },
          "message": {
            "type": "string",
            "const": "Resource already exists"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "resource_type"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/FilterId"
              },
              "resource_type": {
                "type": "string",
                "const": "filter"
              }
            }
          }
        }
      },
      "TransformationId": {
        "type": "string",
        "pattern": "^trs_[A-Za-z0-9_-]+$"
      },
      "MetricsTimeExpression": {
        "type": "string",
        "minLength": 1,
        "description": "ISO 8601 timestamp or relative expression such as now-24h."
      },
      "RequestId": {
        "type": "string",
        "pattern": "^req_[A-Za-z0-9_-]+$"
      },
      "EventId": {
        "type": "string",
        "pattern": "^evt_[A-Za-z0-9_-]+$"
      },
      "AttemptId": {
        "type": "string",
        "pattern": "^att_[A-Za-z0-9_-]+$"
      },
      "BatchOperationId": {
        "type": "string",
        "pattern": "^bch_[A-Za-z0-9_-]+$"
      },
      "RequestCursor": {
        "type": "string",
        "minLength": 1,
        "description": "Opaque descending-page cursor returned as next_cursor."
      },
      "RequestInclude": {
        "type": "string",
        "enum": [
          "data",
          "event_summary",
          "data,event_summary",
          "event_summary,data"
        ]
      },
      "RequestRetryKind": {
        "type": "string",
        "enum": [
          "single",
          "bulk"
        ]
      },
      "RequestListLimit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "ControlListLimit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 255
      },
      "QueryBoolean": {
        "type": "string",
        "enum": [
          "true",
          "false"
        ]
      },
      "RequestAppliedRange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RequestPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "desc"
            ]
          },
          "limit": {
            "$ref": "#/components/schemas/RequestListLimit"
          }
        }
      },
      "RequestModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "status",
          "verified",
          "rejection_cause",
          "original_event_data_id",
          "ingested_at",
          "source_id",
          "events_count",
          "ignored_count",
          "cli_events_count",
          "is_retry",
          "retry_kind",
          "retry_parent_request_id",
          "retry_operation_id",
          "retried_at",
          "updated_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/RequestMetricStatus"
          },
          "verified": {
            "type": "boolean"
          },
          "rejection_cause": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "original_event_data_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ingested_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "events_count": {
            "type": "integer",
            "minimum": 0
          },
          "ignored_count": {
            "type": "integer",
            "minimum": 0
          },
          "cli_events_count": {
            "type": "integer",
            "minimum": 0
          },
          "is_retry": {
            "type": "boolean"
          },
          "retry_kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestRetryKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_parent_request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestId"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_operation_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BatchOperationId"
              },
              {
                "type": "null"
              }
            ]
          },
          "retried_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "data": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "proxy_exchange": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProxyExchangeModel"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RequestListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "total_exact",
          "partial",
          "unavailable_shard_count",
          "limit",
          "applied_range",
          "next_cursor",
          "next",
          "prev",
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "total_exact": {
            "type": "boolean"
          },
          "partial": {
            "type": "boolean"
          },
          "unavailable_shard_count": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "$ref": "#/components/schemas/RequestListLimit"
          },
          "applied_range": {
            "$ref": "#/components/schemas/RequestAppliedRange"
          },
          "next_cursor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestCursor"
              },
              {
                "type": "null"
              }
            ]
          },
          "next": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestCursor"
              },
              {
                "type": "null"
              }
            ]
          },
          "prev": {
            "type": "null"
          },
          "pagination": {
            "$ref": "#/components/schemas/RequestPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestModel"
            }
          }
        }
      },
      "RequestCountResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "count",
          "total_exact",
          "partial",
          "unavailable_shard_count",
          "applied_range"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "total_exact": {
            "type": "boolean"
          },
          "partial": {
            "type": "boolean"
          },
          "unavailable_shard_count": {
            "type": "integer",
            "minimum": 0
          },
          "applied_range": {
            "$ref": "#/components/schemas/RequestAppliedRange"
          }
        }
      },
      "ProxyExchangeModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "source_id",
          "request_id",
          "target_url",
          "http_method",
          "response_status",
          "response_headers",
          "response_body",
          "response_body_truncated",
          "error_text",
          "started_at",
          "responded_at",
          "response_latency",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "target_url": {
            "type": "string",
            "minLength": 1
          },
          "http_method": {
            "type": "string",
            "minLength": 1
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 599
              },
              {
                "type": "null"
              }
            ]
          },
          "response_headers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "response_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "response_body_truncated": {
            "type": "boolean"
          },
          "error_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "responded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "response_latency": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RequestEventModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "webhook_id",
          "source_id",
          "destination_id",
          "attempts",
          "response_status",
          "last_attempt_at",
          "next_attempt_at",
          "successful_at",
          "updated_at",
          "created_at",
          "status",
          "event_data_id",
          "cli_id",
          "request_id",
          "error_code"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/EventId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "webhook_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "destination_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DestinationId"
              },
              {
                "type": "null"
              }
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "successful_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/EventMetricStatus"
          },
          "event_data_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cli_id": {
            "type": "null"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RequestEventPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at",
              "id"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "$ref": "#/components/schemas/ControlListLimit"
          }
        }
      },
      "RequestEventListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "next",
          "prev",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/RequestEventPagination"
          },
          "next": {
            "type": "null"
          },
          "prev": {
            "type": "null"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestEventModel"
            }
          }
        }
      },
      "IgnoredRequestEventModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "webhook_id",
          "cause",
          "request_id",
          "meta",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "webhook_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "cause": {
            "type": "string",
            "minLength": 1
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "meta": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IgnoredRequestEventListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "next",
          "prev",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/RequestEventPagination"
          },
          "next": {
            "type": "null"
          },
          "prev": {
            "type": "null"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IgnoredRequestEventModel"
            }
          }
        }
      },
      "TraceEventModel": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "team_id",
          "request_id",
          "connection_id",
          "source_id",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/EventId"
          },
          "team_id": {
            "type": "string"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "status": {
            "$ref": "#/components/schemas/EventMetricStatus"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TraceAttemptModel": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "team_id",
          "event_id",
          "destination_id",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AttemptId"
          },
          "team_id": {
            "type": "string"
          },
          "event_id": {
            "$ref": "#/components/schemas/EventId"
          },
          "destination_id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "status": {
            "type": "string",
            "enum": [
              "FAILED",
              "SUCCESSFUL"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TraceTransformationModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "event_id",
          "webhook_id",
          "transformed_event_data_id",
          "original_event_data_id",
          "transformation_id",
          "log_level",
          "logs",
          "original_event_data",
          "transformed_event_data",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TransformationExecutionId"
          },
          "team_id": {
            "type": "string"
          },
          "event_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventId"
              },
              {
                "type": "null"
              }
            ]
          },
          "webhook_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "transformed_event_data_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "original_event_data_id": {
            "type": "string"
          },
          "transformation_id": {
            "$ref": "#/components/schemas/TransformationId"
          },
          "log_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "original_event_data": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "transformed_event_data": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RequestTraceTimelineItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "label",
          "at",
          "request_id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "event_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventId"
              },
              {
                "type": "null"
              }
            ]
          },
          "attempt_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AttemptId"
              },
              {
                "type": "null"
              }
            ]
          },
          "transformation_execution_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TransformationExecutionId"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectionId"
              },
              {
                "type": "null"
              }
            ]
          },
          "destination_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DestinationId"
              },
              {
                "type": "null"
              }
            ]
          },
          "proxy_exchange_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RequestTraceResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "request",
          "proxy_exchange",
          "events",
          "ignored_events",
          "attempts",
          "attempts_by_event_id",
          "transformations",
          "transformations_by_event_id",
          "timeline",
          "counts"
        ],
        "properties": {
          "request": {
            "$ref": "#/components/schemas/RequestModel"
          },
          "proxy_exchange": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProxyExchangeModel"
              },
              {
                "type": "null"
              }
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceEventModel"
            }
          },
          "ignored_events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IgnoredRequestEventModel"
            }
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceAttemptModel"
            }
          },
          "attempts_by_event_id": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/TraceAttemptModel"
              }
            }
          },
          "transformations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceTransformationModel"
            }
          },
          "transformations_by_event_id": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/TraceTransformationModel"
              }
            }
          },
          "timeline": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestTraceTimelineItem"
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "events",
              "ignored_events",
              "attempts",
              "transformations",
              "proxy_exchanges"
            ],
            "properties": {
              "events": {
                "type": "integer",
                "minimum": 0
              },
              "ignored_events": {
                "type": "integer",
                "minimum": 0
              },
              "attempts": {
                "type": "integer",
                "minimum": 0
              },
              "transformations": {
                "type": "integer",
                "minimum": 0
              },
              "proxy_exchanges": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1
              }
            }
          }
        }
      },
      "RequestBulkOperationCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "from": {
            "$ref": "#/components/schemas/MetricsTimeExpression"
          },
          "to": {
            "$ref": "#/components/schemas/MetricsTimeExpression"
          },
          "status": {
            "$ref": "#/components/schemas/RequestMetricStatus"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "q": {
            "type": "string"
          }
        }
      },
      "EventBulkOperationCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "from": {
            "$ref": "#/components/schemas/MetricsTimeExpression"
          },
          "to": {
            "$ref": "#/components/schemas/MetricsTimeExpression"
          },
          "status": {
            "$ref": "#/components/schemas/EventMetricStatus"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "webhook_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "destination_id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "q": {
            "type": "string"
          }
        }
      },
      "RequestReplayModifications": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "QUERY",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "HEAD",
              "OPTIONS"
            ]
          },
          "path": {
            "type": "string",
            "maxLength": 2048
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              }
            ]
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "RequestRetryRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "modifications": {
            "$ref": "#/components/schemas/RequestReplayModifications"
          },
          "request": {
            "$ref": "#/components/schemas/RequestReplayModifications"
          },
          "replay": {
            "$ref": "#/components/schemas/RequestReplayModifications"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "QUERY",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "HEAD",
              "OPTIONS"
            ]
          },
          "path": {
            "type": "string",
            "maxLength": 2048
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              }
            ]
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "RequestRetryResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "queued",
          "transport",
          "replayed_at",
          "request_id",
          "source_id",
          "replay_message_id",
          "replay_mode",
          "original_rejection_cause"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "queued": {
            "type": "boolean",
            "const": true
          },
          "transport": {
            "type": "string",
            "const": "queue"
          },
          "replayed_at": {
            "type": "string",
            "format": "date-time"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "replay_message_id": {
            "type": "string",
            "minLength": 1
          },
          "replay_mode": {
            "type": "string",
            "enum": [
              "exact",
              "modified"
            ]
          },
          "original_rejection_cause": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EventRetryResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "queued",
          "transport",
          "retried_at",
          "event_id",
          "replay_event_id"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "queued": {
            "type": "boolean",
            "const": true
          },
          "transport": {
            "type": "string",
            "const": "queue"
          },
          "retried_at": {
            "type": "string",
            "format": "date-time"
          },
          "event_id": {
            "$ref": "#/components/schemas/EventId"
          },
          "replay_event_id": {
            "$ref": "#/components/schemas/EventId"
          }
        }
      },
      "CreateRequestShareRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_in_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "include_body": {
            "type": "boolean"
          },
          "redact_keys": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      },
      "RequestShareModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "token",
          "team_id",
          "request_id",
          "source_id",
          "title",
          "url",
          "share_url",
          "expires_at",
          "revoked_at",
          "access_count",
          "last_accessed_at",
          "created_at",
          "updated_at",
          "sanitized",
          "request"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^shr_[a-f0-9]{24}$"
          },
          "token": {
            "type": "string",
            "pattern": "^rsh_[a-f0-9]{48}$"
          },
          "team_id": {
            "type": "string"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "source_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceId"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "share_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "access_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_accessed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "sanitized": {
            "type": "boolean",
            "const": true
          },
          "request": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "RequestBulkOperationBucket": {
        "type": "string",
        "enum": [
          "all",
          "ongoing",
          "history"
        ]
      },
      "RequestBulkOperationModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "type",
          "status",
          "filter",
          "requested_by",
          "created_at",
          "started_at",
          "finished_at",
          "total_count",
          "queued_count",
          "done_count",
          "failed_count",
          "cancelable"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/BatchOperationId"
          },
          "team_id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "request_bulk_retry"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PLANNED",
              "RUNNING",
              "COMPLETED",
              "FAILED",
              "CANCELLED"
            ]
          },
          "filter": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "total_count": {
            "type": "integer",
            "minimum": 0
          },
          "queued_count": {
            "type": "integer",
            "minimum": 0
          },
          "done_count": {
            "type": "integer",
            "minimum": 0
          },
          "failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "cancelable": {
            "type": "boolean"
          }
        }
      },
      "RequestBulkOperationListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestBulkOperationModel"
            }
          }
        }
      },
      "MetricsGranularity": {
        "type": "string",
        "enum": [
          "1s",
          "5s",
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "1h"
        ]
      },
      "MetricsMeasures": {
        "type": "string",
        "minLength": 1,
        "description": "One or more comma-separated metric names. The measures query parameter may also be repeated."
      },
      "MetricsResourceIds": {
        "type": "string",
        "minLength": 1,
        "description": "One or more comma-separated resource identifiers. The id query parameter may also be repeated."
      },
      "RequestMetricStatus": {
        "type": "string",
        "enum": [
          "accepted",
          "rejected"
        ]
      },
      "EventMetricStatus": {
        "type": "string",
        "enum": [
          "SCHEDULED",
          "QUEUED",
          "HOLD",
          "SUCCESSFUL",
          "FAILED",
          "CANCELLED"
        ]
      },
      "MetricsDateRange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end"
        ],
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MetricsSeriesPoint": {
        "type": "object",
        "required": [
          "timestamp"
        ],
        "additionalProperties": false,
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "accepted_count": {
            "type": "integer",
            "minimum": 0
          },
          "rejected_count": {
            "type": "integer",
            "minimum": 0
          },
          "delivered_count": {
            "type": "integer",
            "minimum": 0
          },
          "failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "queued_count": {
            "type": "integer",
            "minimum": 0
          },
          "processing_count": {
            "type": "integer",
            "minimum": 0
          },
          "hold_count": {
            "type": "integer",
            "minimum": 0
          },
          "ignored_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RequestMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date_range",
          "granularity",
          "series",
          "partial",
          "unavailable_shard_count"
        ],
        "properties": {
          "date_range": {
            "$ref": "#/components/schemas/MetricsDateRange"
          },
          "granularity": {
            "$ref": "#/components/schemas/MetricsGranularity"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricsSeriesPoint"
            }
          },
          "partial": {
            "type": "boolean"
          },
          "unavailable_shard_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EventMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date_range",
          "granularity",
          "series"
        ],
        "properties": {
          "date_range": {
            "$ref": "#/components/schemas/MetricsDateRange"
          },
          "granularity": {
            "$ref": "#/components/schemas/MetricsGranularity"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricsSeriesPoint"
            }
          }
        }
      },
      "SourceMetricModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source_id",
          "requests_24h_count",
          "requests_24h_total_count",
          "requests_24h_accepted_count",
          "requests_24h_rejected_count",
          "requests_24h_accepted_bins",
          "requests_24h_rejected_bins",
          "connections_count"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "requests_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "requests_24h_total_count": {
            "type": "integer",
            "minimum": 0
          },
          "requests_24h_accepted_count": {
            "type": "integer",
            "minimum": 0
          },
          "requests_24h_rejected_count": {
            "type": "integer",
            "minimum": 0
          },
          "requests_24h_accepted_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "requests_24h_rejected_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "connections_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "SourceMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceMetricModel"
            }
          }
        }
      },
      "ConnectionMetricModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "connection_id",
          "webhook_id",
          "events_24h_count",
          "events_24h_successful_count",
          "events_24h_failed_count",
          "events_24h_pending_count",
          "events_24h_cancelled_count",
          "events_24h_bins",
          "events_24h_successful_bins",
          "events_24h_failed_bins",
          "events_24h_pending_bins",
          "events_24h_cancelled_bins"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "webhook_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "events_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "events_24h_successful_count": {
            "type": "integer",
            "minimum": 0
          },
          "events_24h_failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "events_24h_pending_count": {
            "type": "integer",
            "minimum": 0
          },
          "events_24h_cancelled_count": {
            "type": "integer",
            "minimum": 0
          },
          "events_24h_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "events_24h_successful_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "events_24h_failed_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "events_24h_pending_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "events_24h_cancelled_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          }
        }
      },
      "ConnectionMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectionMetricModel"
            }
          }
        }
      },
      "DestinationMetricModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "destination_id",
          "attempts_24h_count",
          "attempts_24h_bins"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "destination_id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "attempts_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "attempts_24h_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          }
        }
      },
      "DestinationMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models",
          "partial",
          "source",
          "failed_destination_ids"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationMetricModel"
            }
          },
          "partial": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "enum": [
              "durable_objects",
              "cache",
              "stale_cache"
            ]
          },
          "failed_destination_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationId"
            }
          }
        }
      },
      "TransformationMetricModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "transformation_id",
          "executions_24h_count",
          "executions_24h_successful_count",
          "executions_24h_failed_count",
          "executions_24h_successful_bins",
          "executions_24h_failed_bins",
          "error_code_counts",
          "connections_count"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TransformationId"
          },
          "transformation_id": {
            "$ref": "#/components/schemas/TransformationId"
          },
          "executions_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "executions_24h_successful_count": {
            "type": "integer",
            "minimum": 0
          },
          "executions_24h_failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "executions_24h_successful_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "executions_24h_failed_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "error_code_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "connections_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TransformationMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransformationMetricModel"
            }
          }
        }
      },
      "TransformationRuntime": {
        "type": "string",
        "enum": [
          "fasthook-dsl-v1",
          "javascript-legacy"
        ]
      },
      "TransformationEnvironment": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      "TransformationMetricBins": {
        "type": "array",
        "minItems": 6,
        "maxItems": 6,
        "items": {
          "type": "integer",
          "minimum": 0
        }
      },
      "TransformationModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "name",
          "code",
          "updated_at",
          "created_at",
          "code_hash",
          "deleted_at",
          "env",
          "runtime",
          "executions_24h_count",
          "executions_24h_successful_count",
          "executions_24h_failed_count",
          "executions_24h_successful_bins",
          "executions_24h_failed_bins",
          "error_code_counts",
          "connections_count"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TransformationId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "code": {
            "type": "string",
            "minLength": 1
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "code_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "env": {
            "$ref": "#/components/schemas/TransformationEnvironment"
          },
          "runtime": {
            "$ref": "#/components/schemas/TransformationRuntime"
          },
          "executions_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "executions_24h_successful_count": {
            "type": "integer",
            "minimum": 0
          },
          "executions_24h_failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "executions_24h_successful_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "executions_24h_failed_bins": {
            "$ref": "#/components/schemas/TransformationMetricBins"
          },
          "error_code_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "connections_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TransformationPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at",
              "updated_at",
              "name"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 255
          }
        }
      },
      "TransformationListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/TransformationPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "models": {
            "type": "array",
            "maxItems": 255,
            "items": {
              "$ref": "#/components/schemas/TransformationModel"
            }
          }
        }
      },
      "CreateTransformationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "code"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "code": {
            "type": "string",
            "minLength": 1
          },
          "env": {
            "$ref": "#/components/schemas/TransformationEnvironment"
          }
        }
      },
      "UpdateTransformationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "code": {
            "type": "string",
            "minLength": 1
          },
          "env": {
            "$ref": "#/components/schemas/TransformationEnvironment"
          }
        }
      },
      "DeleteTransformationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TransformationId"
          }
        }
      },
      "TransformationAlreadyExistsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "const": "RESOURCE_ALREADY_EXISTS"
          },
          "status": {
            "type": "integer",
            "const": 409
          },
          "message": {
            "type": "string",
            "const": "Resource already exists"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "resource_type"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/TransformationId"
              },
              "resource_type": {
                "type": "string",
                "const": "transformation"
              }
            }
          }
        }
      },
      "TransformationExecutionId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 155
      },
      "TransformationExecutionSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "event_id",
          "request_id",
          "created_at",
          "updated_at",
          "webhook_id",
          "transformed_event_data_id",
          "original_event_data_id",
          "transformation_id",
          "runtime",
          "error_code",
          "stats",
          "log_level",
          "logs"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TransformationExecutionId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestId"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "webhook_id": {
            "type": "string",
            "minLength": 1
          },
          "transformed_event_data_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "original_event_data_id": {
            "type": "string",
            "minLength": 1
          },
          "transformation_id": {
            "$ref": "#/components/schemas/TransformationId"
          },
          "runtime": {
            "$ref": "#/components/schemas/TransformationRuntime"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "log_level": {
            "type": "string",
            "minLength": 1
          },
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "TransformationExecutionDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "event_id",
          "request_id",
          "original_event_data_id",
          "transformed_event_data_id",
          "team_id",
          "webhook_id",
          "transformation_id",
          "runtime",
          "error_code",
          "stats",
          "log_level",
          "logs",
          "created_at",
          "updated_at",
          "original_event_data",
          "transformed_event_data"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TransformationExecutionId"
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestId"
              },
              {
                "type": "null"
              }
            ]
          },
          "original_event_data_id": {
            "type": "string",
            "minLength": 1
          },
          "transformed_event_data_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "webhook_id": {
            "type": "string",
            "minLength": 1
          },
          "transformation_id": {
            "$ref": "#/components/schemas/TransformationId"
          },
          "runtime": {
            "$ref": "#/components/schemas/TransformationRuntime"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "log_level": {
            "type": "string",
            "minLength": 1
          },
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "original_event_data": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "transformed_event_data": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TransformationExecutionPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "const": "created_at"
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 255
          }
        }
      },
      "TransformationExecutionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/TransformationExecutionPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "models": {
            "type": "array",
            "maxItems": 255,
            "items": {
              "$ref": "#/components/schemas/TransformationExecutionSummary"
            }
          }
        }
      },
      "TransformationRunInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "headers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "query": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "path": {
            "type": "string"
          },
          "method": {
            "type": "string"
          }
        }
      },
      "TransformationRunOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "headers",
          "body",
          "query",
          "path",
          "method"
        ],
        "properties": {
          "headers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "query": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "path": {
            "type": "string"
          },
          "method": {
            "type": "string"
          }
        }
      },
      "TransformationValidateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          },
          "code_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TransformationDslLimits": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "codeLength",
          "astNodes",
          "executionSteps",
          "loopIterations",
          "collectionOperations",
          "callDepth",
          "consoleLines",
          "consoleLineLength",
          "outputBytes",
          "valueDepth",
          "inputBytes",
          "inputNodes",
          "envBytes",
          "envEntries",
          "regexpPatternLength",
          "regexpInputLength",
          "regexpMatches",
          "regexpCaptures",
          "regexpQuantifiers",
          "regexpRepetition"
        ],
        "properties": {
          "codeLength": {
            "type": "integer",
            "minimum": 0
          },
          "astNodes": {
            "type": "integer",
            "minimum": 0
          },
          "executionSteps": {
            "type": "integer",
            "minimum": 0
          },
          "loopIterations": {
            "type": "integer",
            "minimum": 0
          },
          "collectionOperations": {
            "type": "integer",
            "minimum": 0
          },
          "callDepth": {
            "type": "integer",
            "minimum": 0
          },
          "consoleLines": {
            "type": "integer",
            "minimum": 0
          },
          "consoleLineLength": {
            "type": "integer",
            "minimum": 0
          },
          "outputBytes": {
            "type": "integer",
            "minimum": 0
          },
          "valueDepth": {
            "type": "integer",
            "minimum": 0
          },
          "inputBytes": {
            "type": "integer",
            "minimum": 0
          },
          "inputNodes": {
            "type": "integer",
            "minimum": 0
          },
          "envBytes": {
            "type": "integer",
            "minimum": 0
          },
          "envEntries": {
            "type": "integer",
            "minimum": 0
          },
          "regexpPatternLength": {
            "type": "integer",
            "minimum": 0
          },
          "regexpInputLength": {
            "type": "integer",
            "minimum": 0
          },
          "regexpMatches": {
            "type": "integer",
            "minimum": 0
          },
          "regexpCaptures": {
            "type": "integer",
            "minimum": 0
          },
          "regexpQuantifiers": {
            "type": "integer",
            "minimum": 0
          },
          "regexpRepetition": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TransformationDslCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "globals",
          "namespaces",
          "instanceMethods",
          "instanceProperties",
          "contextualMembers",
          "blockedProperties"
        ],
        "properties": {
          "globals": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "namespaces": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "members"
              ],
              "properties": {
                "members": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "instanceMethods": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              }
            }
          },
          "instanceProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              }
            }
          },
          "contextualMembers": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              }
            }
          },
          "blockedProperties": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TransformationCapabilitiesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "runtime",
          "limits",
          "capabilities"
        ],
        "properties": {
          "runtime": {
            "type": "string",
            "minLength": 1
          },
          "limits": {
            "$ref": "#/components/schemas/TransformationDslLimits"
          },
          "capabilities": {
            "$ref": "#/components/schemas/TransformationDslCapabilities"
          }
        }
      },
      "TransformationValidateResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "valid",
          "runtime",
          "ast_node_count",
          "cache_hit",
          "limits",
          "capabilities"
        ],
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "runtime": {
            "type": "string"
          },
          "ast_node_count": {
            "type": "integer",
            "minimum": 0
          },
          "cache_hit": {
            "type": "boolean"
          },
          "limits": {
            "$ref": "#/components/schemas/TransformationDslLimits"
          },
          "capabilities": {
            "$ref": "#/components/schemas/TransformationDslCapabilities"
          }
        }
      },
      "TransformationRunRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          },
          "env": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "request": {
            "$ref": "#/components/schemas/TransformationRunInput"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "context": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "timestamp": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "TransformationRunTiming": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "started_at",
          "finished_at",
          "duration_ms"
        ],
        "properties": {
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TransformationRunResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "runtime",
          "stats",
          "log_level",
          "console",
          "warnings",
          "request",
          "transformation_run_time"
        ],
        "properties": {
          "runtime": {
            "type": "string"
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "log_level": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "error"
            ]
          },
          "console": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "request": {
            "$ref": "#/components/schemas/TransformationRunOutput"
          },
          "transformation_run_time": {
            "$ref": "#/components/schemas/TransformationRunTiming"
          }
        }
      },
      "WorkflowId": {
        "type": "string",
        "pattern": "^wfl_[A-Za-z0-9_-]+$"
      },
      "WorkflowTestDataResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "steps"
        ],
        "properties": {
          "trigger": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "selected_record": {
            "$ref": "#/components/schemas/WorkflowTestTriggerRecord"
          },
          "steps": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "WorkflowTestTriggerRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key",
          "definition_key",
          "provider_account_id",
          "config"
        ],
        "properties": {
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "definition_key": {
            "type": "string",
            "minLength": 1
          },
          "provider_account_id": {
            "type": "string",
            "minLength": 1
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "WorkflowTestTriggerRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "data",
          "kind"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "data": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "kind": {
            "type": "string",
            "enum": [
              "live",
              "example"
            ]
          }
        }
      },
      "WorkflowTestTriggerResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bundle_id",
          "records",
          "mode"
        ],
        "properties": {
          "bundle_id": {
            "type": "string",
            "minLength": 1
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTestTriggerRecord"
            }
          },
          "mode": {
            "type": "string",
            "enum": [
              "polling",
              "instant"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "WorkflowTestSelectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bundle_id",
          "record_id"
        ],
        "properties": {
          "bundle_id": {
            "type": "string",
            "minLength": 1
          },
          "record_id": {
            "type": "string",
            "minLength": 1
          },
          "source_id": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "WorkflowTestSelectionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "selected"
        ],
        "properties": {
          "selected": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "WorkflowTestLoopStepRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "step_id",
          "payload",
          "idempotency_key"
        ],
        "properties": {
          "step_id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "payload": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "WorkflowTestLoopStepResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "data_out"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "failed"
            ]
          },
          "data_out": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "output_port": {
            "type": "string",
            "enum": [
              "default",
              "error"
            ]
          },
          "warning": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "WorkflowTestActionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action",
          "inputs",
          "idempotency_key"
        ],
        "properties": {
          "action": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "inputs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "payload": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "step_id": {
            "type": "string",
            "minLength": 1
          },
          "draft_step_id": {
            "type": "string",
            "minLength": 1
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "WorkflowTestActionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "data_in",
          "data_out"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "failed"
            ]
          },
          "data_in": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "data_out": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "error": {
            "type": "string"
          },
          "warning": {
            "type": "string"
          }
        }
      },
      "WorkflowStatus": {
        "type": "string",
        "enum": [
          "draft",
          "active",
          "paused",
          "disabled"
        ]
      },
      "WorkflowSummaryCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "trigger_input",
          "step_output_input",
          "branching",
          "sequential_paths",
          "sequential_action_loop"
        ],
        "properties": {
          "trigger_input": {
            "type": "boolean"
          },
          "step_output_input": {
            "type": "boolean"
          },
          "branching": {
            "type": "boolean"
          },
          "sequential_paths": {
            "type": "boolean"
          },
          "sequential_action_loop": {
            "type": "boolean"
          }
        }
      },
      "WorkflowSourceSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "type",
          "status",
          "config",
          "provider_key",
          "definition_key",
          "definition_name",
          "output_schema",
          "export_path",
          "primary_output",
          "schema_provenance",
          "sample"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "provider_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "definition_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "definition_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "output_schema": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "export_path": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "primary_output": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "schema_provenance": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "sample": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "WorkflowSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "source_id",
          "name",
          "status",
          "version",
          "source",
          "integration_provider_keys",
          "steps_count",
          "edges_count",
          "capabilities",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSourceSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "integration_provider_keys": {
            "type": "array",
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          "steps_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "edges_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 250
          },
          "capabilities": {
            "$ref": "#/components/schemas/WorkflowSummaryCapabilities"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkflowListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "models": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/WorkflowSummary"
            }
          }
        }
      },
      "WorkflowStepId": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{4,96}$"
      },
      "WorkflowStepKind": {
        "type": "string",
        "enum": [
          "action",
          "destination",
          "transformation",
          "filter",
          "delay",
          "branch",
          "loop"
        ]
      },
      "WorkflowStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "name",
          "resource_id",
          "action",
          "invocation_inputs",
          "action_revision_id",
          "config",
          "position"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "kind": {
            "$ref": "#/components/schemas/WorkflowStepKind"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "action": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "invocation_inputs": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "action_revision_id": {
            "type": "null"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "position": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "x",
              "y"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            }
          }
        }
      },
      "WorkflowEdge": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source_type",
          "source_step_id",
          "source_port",
          "target_step_id",
          "target_port",
          "mapping",
          "condition",
          "position"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{4,96}$"
          },
          "source_type": {
            "type": "string",
            "enum": [
              "trigger",
              "step"
            ]
          },
          "source_step_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowStepId"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_port": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "target_step_id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "target_port": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "mapping": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "condition": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "position": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "WorkflowRuntimeIssue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "step_id",
          "step_number",
          "step_name",
          "field"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "workflow_step_runtime_unsupported",
              "workflow_multiple_inputs_unsupported"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "step_id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "step_number": {
            "type": "integer",
            "minimum": 2
          },
          "step_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "field": {
            "type": "string",
            "enum": [
              "kind",
              "resource_id",
              "edges"
            ]
          }
        }
      },
      "WorkflowDetailCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "trigger_input",
          "step_output_input",
          "branching",
          "sequential_paths",
          "sequential_action_loop",
          "runtime_executable",
          "runtime_issue"
        ],
        "properties": {
          "trigger_input": {
            "type": "boolean"
          },
          "step_output_input": {
            "type": "boolean"
          },
          "branching": {
            "type": "boolean"
          },
          "sequential_paths": {
            "type": "boolean"
          },
          "sequential_action_loop": {
            "type": "boolean"
          },
          "runtime_executable": {
            "type": "boolean"
          },
          "runtime_issue": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowRuntimeIssue"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "WorkflowDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "source_id",
          "name",
          "status",
          "version",
          "source",
          "integration_provider_keys",
          "steps_count",
          "edges_count",
          "capabilities",
          "created_at",
          "updated_at",
          "steps",
          "edges"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSourceSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "integration_provider_keys": {
            "type": "array",
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          "steps_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "edges_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 250
          },
          "capabilities": {
            "$ref": "#/components/schemas/WorkflowDetailCapabilities"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "test_data": {
            "$ref": "#/components/schemas/WorkflowTestDataResponse"
          },
          "steps": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/WorkflowStep"
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "$ref": "#/components/schemas/WorkflowEdge"
            }
          }
        }
      },
      "WorkflowCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "steps": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "WorkflowUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "steps": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "DeleteWorkflowResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "deleted",
          "source_id",
          "source_deleted"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_deleted": {
            "type": "boolean"
          }
        }
      },
      "WorkflowRunId": {
        "type": "string",
        "pattern": "^(?:wfr|trun)_[A-Za-z0-9_-]+$"
      },
      "WorkflowRunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed"
        ]
      },
      "WorkflowRunSummary": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "request_id",
          "run_type",
          "status",
          "workflow_version",
          "attempt_count",
          "error_code",
          "error_message",
          "steps_count",
          "succeeded_steps",
          "failed_steps",
          "skipped_steps",
          "started_at",
          "finished_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowRunId"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_type": {
            "type": "string",
            "enum": [
              "workflow",
              "trigger"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowRunStatus"
          },
          "workflow_version": {
            "type": "integer",
            "minimum": 0
          },
          "attempt_count": {
            "type": "integer",
            "minimum": 0
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "steps_count": {
            "type": "integer",
            "minimum": 0
          },
          "succeeded_steps": {
            "type": "integer",
            "minimum": 0
          },
          "failed_steps": {
            "type": "integer",
            "minimum": 0
          },
          "skipped_steps": {
            "type": "integer",
            "minimum": 0
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkflowRunListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models",
          "next_cursor"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "models": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/WorkflowRunSummary"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ClearWorkflowRunsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "workflow_id",
          "deleted",
          "retained_active"
        ],
        "properties": {
          "workflow_id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "deleted": {
            "type": "integer",
            "minimum": 0
          },
          "retained_active": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RetryWorkflowStepRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "step_id"
        ],
        "properties": {
          "step_id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "iteration_path": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 999
            },
            "minItems": 1,
            "maxItems": 5,
            "description": "Full zero-based path to a failed iteration; step_id identifies the selected Loop."
          }
        }
      },
      "RetryWorkflowStepResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "workflow_id",
          "workflow_version",
          "status",
          "retry_outbox_id",
          "retry_step"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowRunId"
          },
          "workflow_id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "workflow_version": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "const": "queued"
          },
          "retry_outbox_id": {
            "type": "string",
            "pattern": "^wro_[A-Za-z0-9_-]+$"
          },
          "retry_step": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "step_id",
              "name"
            ],
            "properties": {
              "step_id": {
                "$ref": "#/components/schemas/WorkflowStepId"
              },
              "name": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "retry_iteration": {
            "type": "object",
            "required": [
              "step_id",
              "iteration_path"
            ],
            "properties": {
              "step_id": {
                "$ref": "#/components/schemas/WorkflowStepId"
              },
              "iteration_path": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "WorkflowRunDetail": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "run_type",
          "workflow_id",
          "source_id",
          "request_id",
          "status",
          "attempt_count",
          "error_code",
          "error_message",
          "version",
          "trigger",
          "steps",
          "started_at",
          "finished_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowRunId"
          },
          "run_type": {
            "type": "string",
            "enum": [
              "workflow",
              "trigger"
            ]
          },
          "workflow_id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowRunStatus"
          },
          "attempt_count": {
            "type": "integer",
            "minimum": 0
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "object",
            "additionalProperties": true
          },
          "trigger": {
            "type": "object",
            "additionalProperties": true
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ActionId": {
        "type": "string",
        "pattern": "^act_[A-Za-z0-9_-]+$"
      },
      "ActionStatus": {
        "type": "string",
        "enum": [
          "enabled",
          "disabled"
        ]
      },
      "ActionPublicConfig": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key",
          "action_key",
          "auth_mode",
          "provider_account_id",
          "guild_id",
          "credentials_configured",
          "schema_version",
          "schema_provenance",
          "inputs",
          "rate_limit",
          "rate_limit_period"
        ],
        "properties": {
          "provider_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "action_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "auth_mode": {
            "type": "string",
            "minLength": 1
          },
          "provider_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "guild_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "credentials_configured": {
            "type": "boolean"
          },
          "schema_version": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "schema_provenance": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "inputs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "rate_limit": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "rate_limit_period": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ActionModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "name",
          "type",
          "status",
          "disabled_at",
          "provider_key",
          "action_key",
          "config",
          "workflow_steps_count",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ActionId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "type": {
            "type": "string",
            "const": "ACTION"
          },
          "status": {
            "$ref": "#/components/schemas/ActionStatus"
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "action_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "$ref": "#/components/schemas/ActionPublicConfig"
          },
          "workflow_steps_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ActionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionModel"
            }
          }
        }
      },
      "ActionCreateRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "$ref": "#/components/schemas/ActionStatus"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "ActionUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "$ref": "#/components/schemas/ActionStatus"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "DeleteActionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deleted",
          "id"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "id": {
            "$ref": "#/components/schemas/ActionId"
          }
        }
      },
      "ConnectionId": {
        "type": "string",
        "pattern": "^web_[A-Za-z0-9_-]+$"
      },
      "ConnectionModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "source_id",
          "source_proxy",
          "source_proxy_url",
          "destination_id",
          "description",
          "disabled_at",
          "updated_at",
          "created_at",
          "paused_at",
          "name",
          "rules",
          "destination",
          "source"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "source_id": {
            "type": "string",
            "minLength": 1
          },
          "source_proxy": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "source_proxy_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "destination_id": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "paused_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "destination": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "source": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "ConnectionPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at",
              "updated_at",
              "name"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 255
          }
        }
      },
      "ConnectionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/ConnectionPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "models": {
            "type": "array",
            "maxItems": 255,
            "items": {
              "$ref": "#/components/schemas/ConnectionModel"
            }
          }
        }
      },
      "ConnectionCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_id": {
            "type": "string",
            "minLength": 1
          },
          "destination_id": {
            "type": "string",
            "minLength": 1
          },
          "source": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": true
          },
          "destination": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": true
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "paused_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "ConnectionUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_id": {
            "type": "string",
            "minLength": 1
          },
          "destination_id": {
            "type": "string",
            "minLength": 1
          },
          "source": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": true
          },
          "destination": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": true
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "paused_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "ConnectionLatestInputResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "connection_id",
          "latest_input"
        ],
        "properties": {
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "latest_input": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "source_id",
                  "request_id",
                  "original_event_data_id",
                  "created_at",
                  "payload_r2_key",
                  "payload_r2_bucket_name",
                  "input"
                ],
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "original_event_data_id": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "payload_r2_key": {
                    "type": "string"
                  },
                  "payload_r2_bucket_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeleteConnectionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deleted",
          "id"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "id": {
            "$ref": "#/components/schemas/ConnectionId"
          }
        }
      },
      "SourceId": {
        "type": "string",
        "pattern": "^src_[A-Za-z0-9]+$"
      },
      "SourceType": {
        "type": "string",
        "enum": [
          "WEBHOOK",
          "GITHUB",
          "STRIPE",
          "SHOPIFY",
          "SLACK",
          "SVIX",
          "TWILIO",
          "META",
          "MICROSOFT_GRAPH",
          "GITLAB",
          "HUBSPOT",
          "CLICKFUNNELS",
          "CLOSE",
          "DRIP",
          "AUTOPILOT",
          "SHARPSPRING",
          "EXACT_ONLINE",
          "RAMP",
          "ACTIVETRAIL",
          "GETRESPONSE",
          "GOTO_WEBINAR",
          "ZOOM",
          "SENDGRID",
          "DISCORD",
          "DISCORD_EVENTS",
          "TELEGRAM",
          "AWS_SNS",
          "PAYPAL",
          "MAILGUN",
          "POSTMARK",
          "LINE",
          "DOCUSIGN",
          "DROPBOX",
          "INTERCOM",
          "LINEAR",
          "TYPEFORM",
          "CALENDLY",
          "PADDLE",
          "SQUARE",
          "COINBASE_COMMERCE",
          "RAZORPAY",
          "LEMON_SQUEEZY",
          "ASANA",
          "ZENDESK",
          "OKTA",
          "CLERK",
          "RESEND",
          "WORKOS",
          "NYLAS",
          "XERO",
          "BITBUCKET",
          "TRELLO",
          "WOO_COMMERCE",
          "WEBEX",
          "MUX",
          "VERCEL",
          "HEROKU",
          "BUILDKITE",
          "CIRCLECI",
          "LAUNCHDARKLY",
          "CLICKUP",
          "GRAFANA",
          "SENTRY",
          "REVENUECAT",
          "AUTH0",
          "KLAVIYO",
          "CUSTOMER_IO",
          "HYGRAPH",
          "SANITY",
          "AFTERSHIP",
          "OPENAI",
          "NOTION",
          "TWITCH",
          "CLOUDINARY",
          "PAYSTACK",
          "GOCARDLESS",
          "PAGERDUTY",
          "BIGCOMMERCE",
          "CHARGEBEE_RETENTION",
          "CHECKOUT_COM"
        ]
      },
      "SourceStatus": {
        "type": "string",
        "enum": [
          "enabled",
          "disabled"
        ]
      },
      "SourceInputType": {
        "type": "string",
        "enum": [
          "webhook",
          "provider_trigger"
        ]
      },
      "SourceModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "type",
          "input_type",
          "status",
          "url",
          "config",
          "team_id",
          "disabled_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "$ref": "#/components/schemas/SourceType"
          },
          "input_type": {
            "$ref": "#/components/schemas/SourceInputType"
          },
          "status": {
            "$ref": "#/components/schemas/SourceStatus"
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider_key": {
            "type": "string"
          },
          "definition_key": {
            "type": "string"
          },
          "provider_capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "provider_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "delivery_mode": {
            "type": "string",
            "enum": [
              "instant",
              "polling"
            ]
          },
          "schedule": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "cursor": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "next_run_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_run_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "channel": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "SourceChannelAlertStatus": {
        "type": "string",
        "enum": [
          "active",
          "resolved",
          "all"
        ]
      },
      "SourceOperationalLimit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "SourceChannelEventLimit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 200
      },
      "SourceChannelMetricDays": {
        "type": "integer",
        "minimum": 1,
        "maximum": 90
      },
      "SourceChannelStatus": {
        "type": "string",
        "enum": [
          "connecting",
          "active",
          "error",
          "expiring",
          "fallback"
        ]
      },
      "SourceChannelSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source_id",
          "name",
          "provider_key",
          "definition_key",
          "status",
          "delivery_mode",
          "channel"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "name": {
            "type": "string"
          },
          "provider_key": {
            "type": "string"
          },
          "definition_key": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/SourceStatus"
          },
          "delivery_mode": {
            "type": "string",
            "const": "instant"
          },
          "channel": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SourceChannelListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "$ref": "#/components/schemas/SourceChannelSummary"
            }
          }
        }
      },
      "SourceChannelAlertModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source_id",
          "source_name",
          "provider_key",
          "definition_key",
          "code",
          "status",
          "message",
          "occurrences",
          "first_seen_at",
          "last_seen_at",
          "resolved_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "source_name": {
            "type": "string"
          },
          "provider_key": {
            "type": "string"
          },
          "definition_key": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "resolved"
            ]
          },
          "message": {
            "type": "string"
          },
          "occurrences": {
            "type": "integer",
            "minimum": 0
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SourceChannelAlertListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SourceChannelAlertModel"
            }
          }
        }
      },
      "SourceChannelMetricPoint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metric_date",
          "metric",
          "value"
        ],
        "properties": {
          "metric_date": {
            "type": "string",
            "format": "date"
          },
          "metric": {
            "type": "string"
          },
          "value": {
            "type": "number"
          }
        }
      },
      "SourceChannelMetricsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "series"
        ],
        "properties": {
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceChannelMetricPoint"
            }
          }
        }
      },
      "SourceChannelSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email_enabled",
          "slack_enabled",
          "slack_configured",
          "cooldown_minutes",
          "silence_alert_hours",
          "updated_at"
        ],
        "properties": {
          "email_enabled": {
            "type": "boolean"
          },
          "slack_enabled": {
            "type": "boolean"
          },
          "slack_configured": {
            "type": "boolean"
          },
          "cooldown_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 10080
          },
          "silence_alert_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "UpdateSourceChannelSettingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email_enabled": {
            "type": "boolean"
          },
          "slack_enabled": {
            "type": "boolean"
          },
          "slack_webhook_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "cooldown_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 10080
          },
          "silence_alert_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720
          }
        }
      },
      "BulkSourceChannelsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_ids",
          "action"
        ],
        "properties": {
          "source_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/SourceId"
            }
          },
          "action": {
            "type": "string",
            "enum": [
              "retry",
              "use_polling",
              "use_instant"
            ]
          },
          "schedule": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "auto_fallback": {
            "type": "boolean"
          },
          "max_failures": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "restore_after_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          }
        }
      },
      "BulkSourceChannelError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "error"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "BulkSourceChannelsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "updated",
          "errors"
        ],
        "properties": {
          "updated": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkSourceChannelError"
            }
          }
        }
      },
      "SourceRunQueuedResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source_id",
          "status",
          "reason",
          "scheduled_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^trun_[a-f0-9]{32}$"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "status": {
            "type": "string",
            "const": "scheduled"
          },
          "reason": {
            "type": "string",
            "const": "manual"
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SourceChannelRetryResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_id",
          "status",
          "retry_requested_at"
        ],
        "properties": {
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "status": {
            "type": "string",
            "const": "connecting"
          },
          "retry_requested_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateSourceDeliveryRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "delivery_mode"
        ],
        "properties": {
          "delivery_mode": {
            "type": "string",
            "enum": [
              "instant",
              "polling"
            ]
          },
          "schedule": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "auto_fallback": {
            "type": "boolean"
          },
          "max_failures": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "restore_after_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          }
        }
      },
      "SourceChannelEventsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "events",
          "channels",
          "deliveries"
        ],
        "properties": {
          "events": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/components/schemas/JsonValue"
              }
            }
          },
          "channels": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/components/schemas/JsonValue"
              }
            }
          },
          "deliveries": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/components/schemas/JsonValue"
              }
            }
          }
        }
      },
      "SourceActivityListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/components/schemas/JsonValue"
              }
            }
          }
        }
      },
      "SourcePagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at",
              "updated_at",
              "name"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 255
          }
        }
      },
      "SourceListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/SourcePagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "models": {
            "type": "array",
            "maxItems": 255,
            "items": {
              "$ref": "#/components/schemas/SourceModel"
            }
          }
        }
      },
      "SourceCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "$ref": "#/components/schemas/SourceType"
          },
          "status": {
            "$ref": "#/components/schemas/SourceStatus"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "input_type": {
            "$ref": "#/components/schemas/SourceInputType"
          },
          "definition_key": {
            "type": "string",
            "minLength": 1
          },
          "provider_account_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "SourceUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "$ref": "#/components/schemas/SourceType"
          },
          "status": {
            "$ref": "#/components/schemas/SourceStatus"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "provider_account_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "SourceUpsertRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "$ref": "#/components/schemas/SourceType"
          },
          "status": {
            "$ref": "#/components/schemas/SourceStatus"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "DeleteSourceResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SourceId"
          }
        }
      },
      "DestinationId": {
        "type": "string",
        "pattern": "^des_[A-Za-z0-9_-]+$"
      },
      "DestinationType": {
        "type": "string",
        "enum": [
          "HTTP",
          "CLI",
          "POSTGRESQL",
          "SENDGRID_EMAIL",
          "CLOUDFLARE_R2",
          "AWS_S3"
        ]
      },
      "DestinationStatus": {
        "type": "string",
        "enum": [
          "enabled",
          "disabled"
        ]
      },
      "DestinationModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "name",
          "description",
          "type",
          "config",
          "disabled_at",
          "attempts_24h_count",
          "attempts_24h_bins",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "$ref": "#/components/schemas/DestinationType"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "attempts_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "attempts_24h_bins": {
            "type": "array",
            "minItems": 6,
            "maxItems": 6,
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DestinationPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at",
              "updated_at",
              "name"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 255
          }
        }
      },
      "DestinationListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/DestinationPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "models": {
            "type": "array",
            "maxItems": 255,
            "items": {
              "$ref": "#/components/schemas/DestinationModel"
            }
          }
        }
      },
      "DestinationCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "config"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9-_]+$"
          },
          "type": {
            "$ref": "#/components/schemas/DestinationType"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "DestinationReplaceRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "type",
          "config"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9-_]+$"
          },
          "type": {
            "$ref": "#/components/schemas/DestinationType"
          },
          "status": {
            "$ref": "#/components/schemas/DestinationStatus"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "DestinationUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155,
            "pattern": "^[A-Za-z0-9-_]+$"
          },
          "type": {
            "$ref": "#/components/schemas/DestinationType"
          },
          "status": {
            "$ref": "#/components/schemas/DestinationStatus"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "DeleteDestinationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/DestinationId"
          }
        }
      },
      "ProviderAccountId": {
        "type": "string",
        "minLength": 1
      },
      "ProviderAccountModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "provider_key",
          "name",
          "email",
          "external_account_id",
          "status",
          "scopes",
          "account_kind",
          "connection",
          "token_expires_at",
          "revoked_at",
          "last_error",
          "lifecycle",
          "usage",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProviderAccountId"
          },
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "external_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled",
              "error"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "account_kind": {
            "type": "string",
            "enum": [
              "provider",
              "incoming_webhook"
            ]
          },
          "connection": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "token_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lifecycle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "reconnect_mode",
              "can_revoke",
              "can_reconnect"
            ],
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "expired",
                  "error",
                  "revoked"
                ]
              },
              "reconnect_mode": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "can_revoke": {
                "type": "boolean"
              },
              "can_reconnect": {
                "type": "boolean"
              }
            }
          },
          "usage": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "sources",
              "actions",
              "lookups",
              "total"
            ],
            "properties": {
              "sources": {
                "type": "integer",
                "minimum": 0
              },
              "actions": {
                "type": "integer",
                "minimum": 0
              },
              "lookups": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProviderAccountListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderAccountModel"
            }
          }
        }
      },
      "ProviderOAuthStartRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key"
        ],
        "properties": {
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "definition_key": {
            "type": "string"
          },
          "action_key": {
            "type": "string"
          },
          "provider_account_id": {
            "$ref": "#/components/schemas/ProviderAccountId"
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "authorization_context": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            }
          }
        }
      },
      "ProviderOAuthStartResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "authorization_url",
          "state",
          "expires_at"
        ],
        "properties": {
          "authorization_url": {
            "type": "string",
            "format": "uri"
          },
          "state": {
            "type": "string",
            "minLength": 1
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProviderOAuthCallbackRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "state"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          },
          "state": {
            "type": "string",
            "minLength": 1
          },
          "callback_params": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 2000
            }
          }
        }
      },
      "ProviderCredentialConnectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key",
          "credentials"
        ],
        "properties": {
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "credentials": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        }
      },
      "ProviderAccountOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string"
          },
          "required_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ProviderAccountOptionsResource": {
        "type": "string",
        "minLength": 1
      },
      "ProviderAccountOptionsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderAccountOption"
            }
          }
        }
      },
      "ProviderAccountRevokeResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "revoked_at",
          "provider_revoked",
          "google_revoked",
          "channels_stopped",
          "channels_failed"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProviderAccountId"
          },
          "status": {
            "type": "string",
            "const": "disabled"
          },
          "revoked_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider_revoked": {
            "type": "boolean"
          },
          "google_revoked": {
            "type": "boolean",
            "deprecated": true
          },
          "already_revoked": {
            "type": "boolean"
          },
          "channels_stopped": {
            "type": "integer",
            "minimum": 0
          },
          "channels_failed": {
            "type": "integer",
            "minimum": 0
          },
          "subscriptions_stopped": {
            "type": "integer",
            "minimum": 0
          },
          "subscriptions_failed": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CatalogJsonObject": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/JsonValue"
        }
      },
      "ActionProviderCredentialField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "label",
          "type",
          "required"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "secret"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "placeholder": {
            "type": "string"
          },
          "help": {
            "type": "string"
          }
        }
      },
      "ActionProviderAuthMode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "description"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "fasthook_bot",
              "customer_bot",
              "customer_webhook",
              "none",
              "http_bearer",
              "http_api_key",
              "http_basic"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "ActionProviderAuth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "provider_key",
          "connection_type",
          "credential_fields",
          "modes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "selectable"
          },
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "connection_type": {
            "type": "string",
            "enum": [
              "oauth2",
              "api_key"
            ]
          },
          "credential_fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionProviderCredentialField"
            }
          },
          "modes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ActionProviderAuthMode"
            }
          }
        }
      },
      "ActionProviderRateLimit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requests",
          "period"
        ],
        "properties": {
          "requests": {
            "type": "integer",
            "minimum": 1
          },
          "period": {
            "type": "string",
            "enum": [
              "second",
              "minute",
              "hour",
              "day"
            ]
          }
        }
      },
      "ActionProviderDefinition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "provider_key",
          "name",
          "description",
          "category",
          "required_permissions",
          "required_oauth_scopes",
          "version",
          "transport",
          "auth_modes",
          "default_auth_mode",
          "input_schema",
          "output_schema",
          "schema_provenance",
          "primary_output",
          "input_sample",
          "output_sample",
          "rate_limit"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "type": "string",
            "minLength": 1
          },
          "required_permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "required_oauth_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "transport": {
            "type": "string",
            "enum": [
              "api",
              "webhook"
            ]
          },
          "auth_modes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "fasthook_bot",
                "customer_bot",
                "customer_webhook",
                "none",
                "http_bearer",
                "http_api_key",
                "http_basic"
              ]
            }
          },
          "default_auth_mode": {
            "type": "string",
            "enum": [
              "fasthook_bot",
              "customer_bot",
              "customer_webhook",
              "none",
              "http_bearer",
              "http_api_key",
              "http_basic"
            ]
          },
          "input_schema": {
            "$ref": "#/components/schemas/CatalogJsonObject"
          },
          "output_schema": {
            "$ref": "#/components/schemas/CatalogJsonObject"
          },
          "schema_provenance": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "primary_output": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "input_sample": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "output_sample": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "rate_limit": {
            "$ref": "#/components/schemas/ActionProviderRateLimit"
          }
        }
      },
      "ActionProviderModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "description",
          "icon_key",
          "manifest_version",
          "config_version",
          "capabilities",
          "auth",
          "actions"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "icon_key": {
            "type": "string",
            "minLength": 1
          },
          "manifest_version": {
            "type": "integer",
            "minimum": 1
          },
          "config_version": {
            "type": "integer",
            "minimum": 1
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "auth": {
            "$ref": "#/components/schemas/ActionProviderAuth"
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionProviderDefinition"
            }
          }
        }
      },
      "ActionProviderListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionProviderModel"
            }
          }
        }
      },
      "SourceProviderDefinition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "providerKey",
          "name",
          "description",
          "category",
          "deliveryMode",
          "version",
          "available",
          "outputSchema",
          "exportPath",
          "primaryOutput",
          "sample",
          "schemaProvenance"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "providerKey": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "type": "string",
            "minLength": 1
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "polling",
              "instant"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "available": {
            "type": "boolean"
          },
          "requiredScopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outputSchema": {
            "$ref": "#/components/schemas/CatalogJsonObject"
          },
          "exportPath": {
            "type": "string"
          },
          "primaryOutput": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "sample": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "schemaProvenance": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "SourceProviderModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "manifestVersion",
          "configVersion",
          "eventEnvelopeVersion",
          "capabilities",
          "auth",
          "fields",
          "definitions"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "manifestVersion": {
            "type": "integer",
            "minimum": 1
          },
          "configVersion": {
            "type": "integer",
            "minimum": 1
          },
          "eventEnvelopeVersion": {
            "type": "integer",
            "minimum": 1
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "auth": {
            "$ref": "#/components/schemas/CatalogJsonObject"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogJsonObject"
            }
          },
          "definitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceProviderDefinition"
            }
          },
          "catalogApps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogJsonObject"
            }
          }
        }
      },
      "SourceProviderListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceProviderModel"
            }
          }
        }
      },
      "ActionOptionsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key",
          "resource"
        ],
        "properties": {
          "provider_key": {
            "type": "string",
            "minLength": 1
          },
          "resource": {
            "type": "string",
            "minLength": 1
          },
          "auth_mode": {
            "type": "string",
            "enum": [
              "fasthook_bot",
              "customer_bot",
              "customer_webhook",
              "none",
              "http_bearer",
              "http_api_key",
              "http_basic"
            ]
          },
          "provider_account_id": {
            "$ref": "#/components/schemas/ProviderAccountId"
          },
          "action_id": {
            "type": "string",
            "pattern": "^act_[A-Za-z0-9_-]{8,128}$"
          },
          "credentials": {
            "$ref": "#/components/schemas/CatalogJsonObject"
          },
          "guild_id": {
            "type": "string"
          },
          "query": {
            "type": "string",
            "maxLength": 2000
          },
          "cursor": {
            "type": "string",
            "maxLength": 2000
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "dependencies": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ActionOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          }
        }
      },
      "ActionOptionsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models",
          "next_cursor"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionOption"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "EventBatchOperationScope": {
        "type": "string",
        "enum": [
          "targets",
          "retries",
          "related"
        ],
        "description": "Bulk-operation membership view. Compatibility aliases are normalized by the server."
      },
      "AttemptStatus": {
        "type": "string",
        "enum": [
          "FAILED",
          "SUCCESSFUL"
        ]
      },
      "AttemptOrderBy": {
        "type": "string",
        "enum": [
          "created_at"
        ]
      },
      "AttemptDirection": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ]
      },
      "EventAppliedRange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EventPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit"
        ],
        "properties": {
          "order_by": {
            "type": "string",
            "enum": [
              "created_at"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "desc"
            ]
          },
          "limit": {
            "$ref": "#/components/schemas/RequestListLimit"
          }
        }
      },
      "EventModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "webhook_id",
          "request_id",
          "connection_id",
          "destination_id",
          "event_data_id",
          "source_id",
          "status",
          "rejection_cause",
          "failure_message",
          "ignored_reason",
          "ingested_at",
          "attempts",
          "response_status",
          "last_attempt_at",
          "next_attempt_at",
          "successful_at",
          "is_retry",
          "retry_kind",
          "retry_parent_event_id",
          "retry_operation_id",
          "retried_at",
          "cli_id",
          "error_code",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/EventId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "webhook_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "destination_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DestinationId"
              },
              {
                "type": "null"
              }
            ]
          },
          "event_data_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "status": {
            "$ref": "#/components/schemas/EventMetricStatus"
          },
          "rejection_cause": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "failure_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ignored_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ingested_at": {
            "type": "string",
            "format": "date-time"
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "successful_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_retry": {
            "type": "boolean"
          },
          "retry_kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestRetryKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_parent_event_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventId"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_operation_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BatchOperationId"
              },
              {
                "type": "null"
              }
            ]
          },
          "retried_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "cli_id": {
            "type": "null"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "EventListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "total_exact",
          "limit",
          "applied_range",
          "next_cursor",
          "next",
          "prev",
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "total_exact": {
            "type": "boolean"
          },
          "limit": {
            "$ref": "#/components/schemas/RequestListLimit"
          },
          "applied_range": {
            "$ref": "#/components/schemas/EventAppliedRange"
          },
          "next_cursor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestCursor"
              },
              {
                "type": "null"
              }
            ]
          },
          "next": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestCursor"
              },
              {
                "type": "null"
              }
            ]
          },
          "prev": {
            "type": "null"
          },
          "pagination": {
            "$ref": "#/components/schemas/EventPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventModel"
            }
          }
        }
      },
      "EventCountResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "count",
          "total_exact",
          "applied_range"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "total_exact": {
            "type": "boolean"
          },
          "applied_range": {
            "$ref": "#/components/schemas/EventAppliedRange"
          }
        }
      },
      "AttemptPagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order_by",
          "dir",
          "limit",
          "next",
          "prev"
        ],
        "properties": {
          "order_by": {
            "$ref": "#/components/schemas/AttemptOrderBy"
          },
          "dir": {
            "$ref": "#/components/schemas/AttemptDirection"
          },
          "limit": {
            "$ref": "#/components/schemas/ControlListLimit"
          },
          "next": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestCursor"
              },
              {
                "type": "null"
              }
            ]
          },
          "prev": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestCursor"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AttemptModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "event_id",
          "request_id",
          "connection_id",
          "source_id",
          "destination_id",
          "response_status",
          "attempt_number",
          "trigger",
          "error_code",
          "body",
          "requested_url",
          "http_method",
          "bulk_retry_id",
          "status",
          "successful_at",
          "delivered_at",
          "responded_at",
          "delivery_latency",
          "response_latency",
          "updated_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AttemptId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "event_id": {
            "$ref": "#/components/schemas/EventId"
          },
          "request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestId"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectionId"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceId"
              },
              {
                "type": "null"
              }
            ]
          },
          "destination_id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "attempt_number": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "requested_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "http_method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bulk_retry_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BatchOperationId"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/AttemptStatus"
          },
          "successful_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "responded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "delivery_latency": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "response_latency": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AttemptListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pagination",
          "count",
          "models"
        ],
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/AttemptPagination"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttemptModel"
            }
          }
        }
      },
      "EventBulkOperationModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "type",
          "status",
          "filter",
          "requested_by",
          "created_at",
          "started_at",
          "finished_at",
          "total_count",
          "queued_count",
          "done_count",
          "failed_count",
          "cancelable"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/BatchOperationId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "event_bulk_retry"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PLANNED",
              "RUNNING",
              "COMPLETED",
              "FAILED",
              "CANCELLED"
            ]
          },
          "filter": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "total_count": {
            "type": "integer",
            "minimum": 0
          },
          "queued_count": {
            "type": "integer",
            "minimum": 0
          },
          "done_count": {
            "type": "integer",
            "minimum": 0
          },
          "failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "cancelable": {
            "type": "boolean"
          }
        }
      },
      "EventBulkOperationListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventBulkOperationModel"
            }
          }
        }
      },
      "RequestFixtureId": {
        "type": "string",
        "pattern": "^fix_[a-f0-9]{20}$"
      },
      "RequestFixtureName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120,
        "pattern": "\\S"
      },
      "RequestFixtureDescription": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 500
          },
          {
            "type": "null"
          }
        ]
      },
      "RequestFixtureModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "source_id",
          "source_name",
          "original_request_id",
          "replay_count",
          "last_replayed_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RequestFixtureId"
          },
          "name": {
            "$ref": "#/components/schemas/RequestFixtureName"
          },
          "description": {
            "$ref": "#/components/schemas/RequestFixtureDescription"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "source_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "original_request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestId"
              },
              {
                "type": "null"
              }
            ]
          },
          "replay_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_replayed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RequestFixtureListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestFixtureModel"
            }
          }
        }
      },
      "CreateRequestFixtureRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "request_id",
          "name"
        ],
        "properties": {
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "name": {
            "$ref": "#/components/schemas/RequestFixtureName"
          },
          "description": {
            "$ref": "#/components/schemas/RequestFixtureDescription"
          }
        }
      },
      "UpdateRequestFixtureRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/RequestFixtureName"
          },
          "description": {
            "$ref": "#/components/schemas/RequestFixtureDescription"
          }
        }
      },
      "DeleteRequestFixtureResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deleted",
          "id"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "id": {
            "$ref": "#/components/schemas/RequestFixtureId"
          }
        }
      },
      "RequestFixtureTarget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "connection_id",
          "connection_name",
          "source_id",
          "source_name",
          "destination_id",
          "destination_name",
          "destination_type"
        ],
        "properties": {
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "connection_name": {
            "type": "string"
          },
          "source_id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "source_name": {
            "type": "string"
          },
          "destination_id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "destination_name": {
            "type": "string"
          },
          "destination_type": {
            "$ref": "#/components/schemas/DestinationType"
          }
        }
      },
      "RequestFixtureTargetsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestFixtureTarget"
            }
          }
        }
      },
      "ReplayRequestFixtureRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "connection_id"
        ],
        "properties": {
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          }
        }
      },
      "ReplayRequestFixtureResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "queued",
          "fixture_id",
          "connection_id",
          "destination_id",
          "message_id",
          "replayed_at"
        ],
        "properties": {
          "queued": {
            "type": "boolean",
            "const": true
          },
          "fixture_id": {
            "$ref": "#/components/schemas/RequestFixtureId"
          },
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "destination_id": {
            "$ref": "#/components/schemas/DestinationId"
          },
          "message_id": {
            "type": "string",
            "pattern": "^fxr_[a-f0-9]{20}$"
          },
          "replayed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicRequestShareToken": {
        "type": "string",
        "pattern": "^rsh_[a-f0-9]{48}$"
      },
      "PublicApiErrorDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          },
          "message": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "PublicApiErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/PublicApiErrorDetail"
          }
        }
      },
      "WorkflowTemplateKey": {
        "type": "string",
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
        "maxLength": 96
      },
      "WorkflowTemplateTrigger": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key",
          "definition_key",
          "name",
          "description"
        ],
        "properties": {
          "provider_key": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
          },
          "definition_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          }
        }
      },
      "WorkflowTemplateStepSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "provider_key",
          "action_key",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "provider_key": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
          },
          "action_key": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          }
        }
      },
      "WorkflowTemplateModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "version",
          "name",
          "description",
          "trigger",
          "steps",
          "required_connections",
          "updated_at"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/WorkflowTemplateKey"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "trigger": {
            "$ref": "#/components/schemas/WorkflowTemplateTrigger"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTemplateStepSummary"
            }
          },
          "required_connections": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkflowTemplateListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "models"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTemplateModel"
            }
          }
        }
      },
      "InstantiateWorkflowTemplateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          }
        }
      },
      "InstantiatedWorkflowTemplateTrigger": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider_key",
          "definition_key",
          "name"
        ],
        "properties": {
          "provider_key": {
            "type": "string"
          },
          "definition_key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "InstantiatedWorkflowTemplate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "version",
          "trigger"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/WorkflowTemplateKey"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "trigger": {
            "$ref": "#/components/schemas/InstantiatedWorkflowTemplateTrigger"
          }
        }
      },
      "InstantiateWorkflowTemplateResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "team_id",
          "source_id",
          "name",
          "status",
          "version",
          "source",
          "steps_count",
          "edges_count",
          "capabilities",
          "created_at",
          "updated_at",
          "steps",
          "edges",
          "template"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "team_id": {
            "type": "string",
            "minLength": 1
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 155
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSourceSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "steps_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "edges_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 250
          },
          "capabilities": {
            "$ref": "#/components/schemas/WorkflowDetailCapabilities"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "steps": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/WorkflowStep"
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "$ref": "#/components/schemas/WorkflowEdge"
            }
          },
          "template": {
            "$ref": "#/components/schemas/InstantiatedWorkflowTemplate"
          }
        }
      },
      "WorkflowActivityStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed"
        ]
      },
      "WorkflowActivityStepStatus": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "succeeded",
          "failed",
          "skipped"
        ]
      },
      "WorkflowActivityStepInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_type",
          "source_step_id",
          "source_port"
        ],
        "properties": {
          "source_type": {
            "type": "string",
            "minLength": 1
          },
          "source_step_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_port": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "WorkflowActivityStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "step_id",
          "name",
          "kind",
          "status",
          "execution_index",
          "input",
          "output_port",
          "response_status",
          "error_code",
          "error_message",
          "started_at",
          "finished_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "step_id": {
            "$ref": "#/components/schemas/WorkflowStepId"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "$ref": "#/components/schemas/WorkflowStepKind"
          },
          "loop_id": {
            "description": "Containing Loop from the immutable run version, or null for a step outside a Loop.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowStepId"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowActivityStepStatus"
          },
          "execution_index": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "input": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowActivityStepInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "output_port": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 599
              },
              {
                "type": "null"
              }
            ]
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "WorkflowActivitySource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "provider_key",
          "trigger_name"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SourceId"
          },
          "name": {
            "type": "string"
          },
          "provider_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger_name": {
            "type": "string"
          }
        }
      },
      "WorkflowActivityModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "request_id",
          "workflow_id",
          "workflow_name",
          "workflow_version",
          "source",
          "status",
          "attempt_count",
          "steps_count",
          "succeeded_steps",
          "failed_steps",
          "skipped_steps",
          "error_code",
          "error_message",
          "steps",
          "started_at",
          "finished_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/WorkflowRunId"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          },
          "workflow_id": {
            "$ref": "#/components/schemas/WorkflowId"
          },
          "workflow_name": {
            "type": "string"
          },
          "workflow_version": {
            "type": "integer",
            "minimum": 1
          },
          "source": {
            "$ref": "#/components/schemas/WorkflowActivitySource"
          },
          "status": {
            "$ref": "#/components/schemas/WorkflowActivityStatus"
          },
          "attempt_count": {
            "type": "integer",
            "minimum": 0
          },
          "steps_count": {
            "type": "integer",
            "minimum": 0
          },
          "succeeded_steps": {
            "type": "integer",
            "minimum": 0
          },
          "failed_steps": {
            "type": "integer",
            "minimum": 0
          },
          "skipped_steps": {
            "type": "integer",
            "minimum": 0
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowActivityStep"
            }
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkflowActivityListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "count",
          "models"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowActivityModel"
            }
          }
        }
      },
      "WorkflowActivityLimit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "WorkflowActivityTime": {
        "type": "string",
        "minLength": 1
      },
      "WorkflowActivityQuery": {
        "type": "string",
        "maxLength": 200
      },
      "WorkflowLoopIterations": {
        "type": "object",
        "required": [
          "step_id",
          "iteration_path",
          "total",
          "matched",
          "offset",
          "limit",
          "next_offset",
          "items"
        ],
        "properties": {
          "step_id": {
            "type": "string"
          },
          "iteration_path": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "total": {
            "type": "integer"
          },
          "matched": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "WorkflowIterationQueryStepId": {
        "type": "string"
      },
      "WorkflowIterationQueryIterationPath": {
        "type": "string"
      },
      "WorkflowIterationQueryStatus": {
        "type": "string"
      },
      "WorkflowIterationQuerySearch": {
        "type": "string"
      },
      "WorkflowIterationQueryOffset": {
        "type": "integer",
        "minimum": 0
      },
      "WorkflowIterationQueryLimit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 50
      },
      "WorkflowIterationQueryIndex": {
        "type": "integer",
        "minimum": 0,
        "maximum": 999
      },
      "WorkflowAggregateConfig": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "engine",
          "version",
          "source_loop_id",
          "source_step_id",
          "operation"
        ],
        "properties": {
          "engine": {
            "const": "aggregate"
          },
          "version": {
            "const": 1
          },
          "source_loop_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{4,96}$"
          },
          "source_step_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{4,96}$"
          },
          "operation": {
            "enum": [
              "sum",
              "count",
              "average",
              "min",
              "max",
              "collect"
            ]
          },
          "field": {
            "type": "string",
            "maxLength": 1024
          },
          "missing": {
            "enum": [
              "error",
              "skip"
            ],
            "default": "error"
          },
          "statuses": {
            "type": "array",
            "items": {
              "enum": [
                "succeeded"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "default": [
              "succeeded"
            ],
            "maxItems": 1
          },
          "flatten": {
            "type": "boolean",
            "default": false,
            "description": "Collect only. Expand each selected array by one level before removing duplicates."
          },
          "deduplicate": {
            "enum": [
              "none",
              "value",
              "field"
            ],
            "default": "none",
            "description": "Collect only. Preserve first occurrence by JSON value or a relative field."
          },
          "deduplicate_field": {
            "type": "string",
            "maxLength": 1024,
            "description": "Relative field of each collected element, required in field mode. Missing key fails."
          }
        }
      },
      "WorkflowAggregateResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "considered_count",
          "included_count",
          "skipped_count",
          "failed_count",
          "filtered_count",
          "missing_count"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "considered_count": {
            "type": "integer",
            "minimum": 0
          },
          "included_count": {
            "type": "integer",
            "minimum": 0
          },
          "skipped_count": {
            "type": "integer",
            "minimum": 0
          },
          "failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "filtered_count": {
            "type": "integer",
            "minimum": 0
          },
          "missing_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "WorkflowAggregateTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "config",
          "source_output"
        ],
        "properties": {
          "config": {
            "$ref": "#/components/schemas/WorkflowAggregateConfig"
          },
          "source_output": {
            "$ref": "#/components/schemas/JsonValue"
          }
        }
      },
      "WorkflowAggregateTestResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data_out",
          "warnings"
        ],
        "properties": {
          "data_out": {
            "$ref": "#/components/schemas/WorkflowAggregateResult"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WorkflowAggregateErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "field": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
