Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(warehouse_sources): add Custom REST source preview/test-read endpoint (#65423)

Marcus Hof7a4463bac23f
diff --git a/products/data_warehouse/backend/api/external_data_source.py b/products/data_warehouse/backend/api/external_data_source.py
index 4be429f1211b..692d67e0df7f 100644
--- a/products/data_warehouse/backend/api/external_data_source.py
+++ b/products/data_warehouse/backend/api/external_data_source.py
@@ -132,8 +132,12 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.sql
from products.warehouse_sources.backend.temporal.data_imports.sources.common.sql.base import SQLSource
from products.warehouse_sources.backend.temporal.data_imports.sources.custom.source import (
MAX_CUSTOM_SOURCES_PER_TEAM,
+ PREVIEW_DEFAULT_ROWS,
+ PREVIEW_MAX_ROWS,
+ CustomSource,
manifest_request_hosts,
)
+from products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs import CustomSourceConfig
from products.warehouse_sources.backend.temporal.data_imports.sources.mysql.source import MySQLSource
from products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.config import (
DEFAULT_LAG_CRITICAL_THRESHOLD_MB,
@@ -1277,6 +1281,58 @@ class DatabaseSchemaRequestSerializer(serializers.Serializer):
)
+class SourcePreviewRequestSerializer(serializers.Serializer):
+ source_type = serializers.ChoiceField(
+ choices=ExternalDataSourceType.choices,
+ help_text="The source type to preview. Only 'Custom' (a user-defined REST API) is supported today.",
+ )
+ payload = serializers.DictField(
+ required=False,
+ help_text=(
+ "Source config as flat keys. For source_type 'Custom': 'manifest_json' (a stringified RESTAPIConfig "
+ "describing client.base_url, auth, and resources) plus the credential for the manifest's declared auth "
+ "type — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic). Secrets stay "
+ "in these auth_* keys, never inline in the manifest."
+ ),
+ )
+ resource_name = serializers.CharField(
+ help_text="Which manifest resource (table) to read a sample from — one of the resource names in manifest_json.",
+ )
+ limit = serializers.IntegerField(
+ required=False,
+ default=PREVIEW_DEFAULT_ROWS,
+ min_value=1,
+ max_value=PREVIEW_MAX_ROWS,
+ help_text=f"Maximum sample rows to return (1–{PREVIEW_MAX_ROWS}). Defaults to {PREVIEW_DEFAULT_ROWS}.",
+ )
+
+
+class SourcePreviewColumnSerializer(serializers.Serializer):
+ name = serializers.CharField(help_text="Column name as it appears in the previewed rows.")
+ type = serializers.CharField(
+ help_text="JSON type inferred from the first non-null value: string, integer, number, boolean, object, array, or null."
+ )
+
+
+class SourcePreviewResponseSerializer(serializers.Serializer):
+ rows = serializers.ListField(
+ child=serializers.DictField(),
+ help_text="Up to `limit` sample rows, after data_selector extraction — the raw records the sync would ingest.",
+ )
+ row_count = serializers.IntegerField(help_text="Number of sample rows returned (≤ limit).")
+ columns = SourcePreviewColumnSerializer(
+ many=True,
+ help_text="Columns observed across the sample rows, each with an inferred JSON type.",
+ )
+ error = serializers.CharField(
+ allow_null=True,
+ help_text=(
+ "Set when the live read failed (e.g. the host was unreachable or returned an auth error); rows is then "
+ "empty. Manifest, validation, and SSRF problems return HTTP 400 instead of populating this field."
+ ),
+ )
+
+
class SimpleExternalDataSourceSerializers(serializers.ModelSerializer):
class Meta:
model = ExternalDataSource
@@ -1318,6 +1374,9 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
"enable_cdc",
"disable_cdc",
"update_cdc_settings",
+ # Live outbound HTTP to a caller-supplied manifest (including POSTs) — a
+ # side-effecting action, so it needs write scope, not read.
+ "preview_resource",
]
scope_object_read_actions = [
"list",
@@ -2454,6 +2513,61 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
response.data["webhook"] = webhook_result
return response
+ @extend_schema(request=SourcePreviewRequestSerializer, responses={200: SourcePreviewResponseSerializer})
+ @action(methods=["POST"], detail=False)
+ def preview_resource(self, request: Request, *args: Any, **kwargs: Any) -> Response:
+ """Read a bounded sample of rows for one resource of a Custom REST source.
+
+ Lets a manifest author verify `data_selector`, `primary_key`, and the incremental
+ `cursor_path` against live data before creating the source. Only `source_type: "Custom"`
+ is supported — other source types return 400. The read is bounded (single page per
+ resource, capped row count, short timeouts, no redirects). Manifest, validation, and SSRF
+ problems return 400; a live fetch failure returns 200 with `error` set and empty `rows`.
+ """
+ serializer = SourcePreviewRequestSerializer(data=request.data)
+ serializer.is_valid(raise_exception=True)
+
+ source_type = serializer.validated_data["source_type"]
+ source = SourceRegistry.get_source(ExternalDataSourceType(source_type))
+ if not isinstance(source, CustomSource):
+ return Response(
+ status=status.HTTP_400_BAD_REQUEST,
+ data={"message": f"Preview is not supported for source type '{source_type}'."},
+ )
+
+ payload = dict(serializer.validated_data.get("payload") or {})
+ is_valid, errors = source.validate_config(payload)
+ if not is_valid:
+ return Response(
+ status=status.HTTP_400_BAD_REQUEST,
+ data={"message": f"Invalid source config: {', '.join(errors)}"},
+ )
+ source_config = source.parse_config(payload)
+
+ try:
+ # preview_resource runs its own SSRF host check and bounded live read, so no
+ # separate validate_credentials probe — the read is the credential check.
+ result = source.preview_resource(
+ cast(CustomSourceConfig, source_config),
+ self.team_id,
+ serializer.validated_data["resource_name"],
+ serializer.validated_data["limit"],
+ )
+ except ValueError as e:
+ # ManifestValidationError (a ValueError) for manifest/graph/URL issues, or a plain
+ # ValueError for an unknown resource_name / dependency cycle — all caller mistakes.
+ return Response(status=status.HTTP_400_BAD_REQUEST, data={"message": str(e)})
+
+ return Response(
+ status=status.HTTP_200_OK,
+ data={
+ "rows": result.rows,
+ "row_count": result.row_count,
+ "columns": result.columns,
+ "error": result.error,
+ },
+ )
+
def _auto_register_webhook(
self,
source: WebhookSource,
diff --git a/products/data_warehouse/backend/api/test/test_external_data_source.py b/products/data_warehouse/backend/api/test/test_external_data_source.py
index d76fb47dfd55..9dd7d0ae1fb1 100644
--- a/products/data_warehouse/backend/api/test/test_external_data_source.py
+++ b/products/data_warehouse/backend/api/test/test_external_data_source.py
@@ -57,7 +57,13 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.bas
WebhookCreationResult,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.schema import SourceSchema
-from products.warehouse_sources.backend.temporal.data_imports.sources.custom.source import MAX_CUSTOM_SOURCES_PER_TEAM
+from products.warehouse_sources.backend.temporal.data_imports.sources.custom.source import (
+ MAX_CUSTOM_SOURCES_PER_TEAM,
+ PREVIEW_DEFAULT_ROWS,
+ PREVIEW_MAX_ROWS,
+ ManifestValidationError,
+ PreviewResult,
+)
from products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter import PostgresCDCAdapter
from products.warehouse_sources.backend.temporal.data_imports.sources.postgres.postgres import (
PostgresDiscoveredSchema,
@@ -9798,3 +9804,163 @@ class TestExternalDataSourceStoreCredentials(APIBaseTest):
response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/stored_credentials/")
assert response.status_code == status.HTTP_200_OK
assert [result["credential_id"] for result in response.json()] == [str(newer.pk), str(older.pk)]
+
+
+_PREVIEW_MANIFEST = {
+ "client": {
+ "base_url": "https://api.example.com",
+ "auth": {"type": "api_key", "name": "key", "location": "query"},
+ },
+ "resources": [
+ {"name": "users", "primary_key": "id", "endpoint": {"path": "/users", "data_selector": "data"}},
+ ],
+}
+
+
+class TestExternalDataSourcePreviewAndCustomPayload(APIBaseTest):
+ def _url(self, action: str) -> str:
+ return f"/api/environments/{self.team.pk}/external_data_sources/{action}/"
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.CustomSource.preview_resource"
+ )
+ def test_preview_resource_happy_path(self, mock_preview):
+ mock_preview.return_value = PreviewResult(
+ rows=[{"id": 1, "name": "a"}],
+ row_count=1,
+ columns=[{"name": "id", "type": "integer"}, {"name": "name", "type": "string"}],
+ error=None,
+ )
+
+ response = self.client.post(
+ self._url("preview_resource"),
+ data={
+ "source_type": "Custom",
+ "payload": {"manifest_json": json.dumps(_PREVIEW_MANIFEST), "auth_api_key": "sk_test"},
+ "resource_name": "users",
+ },
+ )
+
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ body = response.json()
+ assert body["row_count"] == 1
+ assert body["rows"] == [{"id": 1, "name": "a"}]
+ assert body["columns"] == [{"name": "id", "type": "integer"}, {"name": "name", "type": "string"}]
+ assert body["error"] is None
+ assert mock_preview.call_args.args[2] == "users"
+ assert mock_preview.call_args.args[3] == PREVIEW_DEFAULT_ROWS
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.CustomSource.preview_resource"
+ )
+ def test_preview_resource_forwards_explicit_limit(self, mock_preview):
+ mock_preview.return_value = PreviewResult(rows=[], row_count=0, columns=[], error=None)
+
+ response = self.client.post(
+ self._url("preview_resource"),
+ data={
+ "source_type": "Custom",
+ "payload": {"manifest_json": json.dumps(_PREVIEW_MANIFEST)},
+ "resource_name": "users",
+ "limit": 25,
+ },
+ )
+
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ assert mock_preview.call_args.args[3] == 25
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.CustomSource.preview_resource"
+ )
+ def test_preview_resource_manifest_error_returns_400(self, mock_preview):
+ mock_preview.side_effect = ManifestValidationError("resources[0].endpoint.path: must not be empty")
+
+ response = self.client.post(
+ self._url("preview_resource"),
+ data={
+ "source_type": "Custom",
+ "payload": {"manifest_json": json.dumps(_PREVIEW_MANIFEST)},
+ "resource_name": "users",
+ },
+ )
+
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert "must not be empty" in response.json()["message"]
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.CustomSource.preview_resource"
+ )
+ def test_preview_resource_fetch_error_returns_200_with_error(self, mock_preview):
+ mock_preview.return_value = PreviewResult(rows=[], row_count=0, columns=[], error="could not reach host")
+
+ response = self.client.post(
+ self._url("preview_resource"),
+ data={
+ "source_type": "Custom",
+ "payload": {"manifest_json": json.dumps(_PREVIEW_MANIFEST)},
+ "resource_name": "users",
+ },
+ )
+
+ assert response.status_code == status.HTTP_200_OK
+ assert response.json()["error"] == "could not reach host"
+ assert response.json()["rows"] == []
+
+ def test_preview_resource_non_custom_source_returns_400(self):
+ response = self.client.post(
+ self._url("preview_resource"),
+ data={"source_type": "Stripe", "payload": {"api_key": "sk"}, "resource_name": "charges"},
+ )
+
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert "not supported" in response.json()["message"]
+
+ def test_preview_resource_limit_over_cap_returns_400(self):
+ response = self.client.post(
+ self._url("preview_resource"),
+ data={
+ "source_type": "Custom",
+ "payload": {"manifest_json": json.dumps(_PREVIEW_MANIFEST)},
+ "resource_name": "users",
+ "limit": PREVIEW_MAX_ROWS + 1,
+ },
+ )
+
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.CustomSource.validate_credentials",
+ return_value=(True, None),
+ )
+ def test_database_schema_accepts_custom_payload(self, _mock_validate):
+ response = self.client.post(
+ self._url("database_schema"),
+ data={
+ "source_type": "Custom",
+ "manifest_json": json.dumps(_PREVIEW_MANIFEST),
+ "auth_api_key": "sk_test",
+ },
+ )
+
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ assert [table["table"] for table in response.json()] == ["users"]
+
+ @patch("products.data_warehouse.backend.api.external_data_source.trigger_external_data_source_workflow")
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.CustomSource.validate_credentials",
+ return_value=(True, None),
+ )
+ def test_setup_accepts_custom_payload(self, _mock_validate, _mock_trigger):
+ response = self.client.post(
+ self._url("setup"),
+ data={
+ "source_type": "Custom",
+ "payload": {"manifest_json": json.dumps(_PREVIEW_MANIFEST), "auth_api_key": "sk_test"},
+ "prefix": "custom_preview_",
+ },
+ )
+
+ assert response.status_code == status.HTTP_201_CREATED, response.json()
+ source = ExternalDataSource.objects.get(id=response.json()["id"])
+ assert source.source_type == "Custom"
+ assert source.created_via == ExternalDataSource.CreatedVia.MCP
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py
index 6003b10137db..a3ef383dd6eb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py
@@ -19,7 +19,7 @@ from .config_setup import (
from .jsonpath_utils import TJsonPath
from .paginators import BasePaginator
from .resource import Resource
-from .rest_client import RESTClient
+from .rest_client import DEFAULT_RETRY_ATTEMPTS, RESTClient
from .typing import ClientConfig, Endpoint, EndpointResource, HTTPMethodBasic, ResolvedParam, RESTAPIConfig
from .utils import exclude_keys # noqa: F401
@@ -212,6 +212,7 @@ def create_resources(
auth=create_auth(client_config.get("auth")),
paginator=create_paginator(client_config.get("paginator")),
session=client_config.get("session"),
+ max_retry_attempts=client_config.get("max_retries", DEFAULT_RETRY_ATTEMPTS),
)
hooks = create_response_hooks(endpoint_config.get("response_actions"))
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py
index 6ae612366275..feeffc2cc744 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py
@@ -11,7 +11,7 @@ from requests.exceptions import (
ChunkedEncodingError,
JSONDecodeError as RequestsJSONDecodeError,
)
-from tenacity import RetryCallState, retry, retry_if_exception_type, stop_after_attempt
+from tenacity import RetryCallState, retry, retry_if_exception_type
from products.warehouse_sources.backend.temporal.data_imports.sources.common.http import make_tracked_session
@@ -34,6 +34,10 @@ class RESTClientRetryableError(Exception):
# misreported header can't stall a worker for an unbounded amount of time.
MAX_RETRY_AFTER_SECONDS = 300.0
+# Attempts for the default sync path. The inline preview overrides this to 1 so a
+# rate-limited endpoint surfaces an error instead of sleeping on `Retry-After`.
+DEFAULT_RETRY_ATTEMPTS = 5
+
def _parse_retry_after(response: Response) -> Optional[float]:
"""Best-effort retry delay (seconds) from a rate-limited / erroring response.
@@ -71,6 +75,15 @@ def _parse_retry_after(response: Response) -> Optional[float]:
return None
+def _stop_after_client_attempts(state: RetryCallState) -> bool:
+ # tenacity passes the wrapped call's positional args; for the bound
+ # `_send_request(self, ...)` that's `(client, request, hooks)`, so the
+ # attempt cap reads off the instance and the preview can lower it to 1.
+ client = state.args[0] if state.args else None
+ max_attempts = getattr(client, "_max_retry_attempts", DEFAULT_RETRY_ATTEMPTS)
+ return state.attempt_number >= max_attempts
+
+
def _retry_wait_seconds(state: RetryCallState) -> float:
fallback = min(2 ** (state.attempt_number - 1), 60)
if state.outcome is None or not state.outcome.failed:
@@ -92,11 +105,13 @@ class RESTClient:
auth: Optional[AuthBase] = None,
paginator: Optional[BasePaginator] = None,
session: Optional[Session] = None,
+ max_retry_attempts: int = DEFAULT_RETRY_ATTEMPTS,
) -> None:
self.base_url = base_url or ""
self.headers = headers or {}
self.auth = auth
self.paginator = paginator
+ self._max_retry_attempts = max_retry_attempts
# Default to the tracked session so every source built on top of
# `RESTClient` participates in HTTP logging, metrics, and sample
# capture. Callers can pass a pre-built `Session` for tests or
@@ -165,7 +180,7 @@ class RESTClient:
@retry(
retry=retry_if_exception_type(RESTClientRetryableError),
- stop=stop_after_attempt(5),
+ stop=_stop_after_client_attempts,
wait=_retry_wait_seconds,
reraise=True,
)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py
index 18649dc3bbe2..0b5b6ec082ce 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py
@@ -375,6 +375,29 @@ class TestRESTClient:
assert mock_session.send.call_count == 5
+ @patch("tenacity.nap.time.sleep")
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client.make_tracked_session"
+ )
+ def test_max_retry_attempts_one_does_not_retry_or_sleep(self, MockSession, mock_sleep) -> None:
+ # The inline preview sets max_retry_attempts=1: a 429 with a long Retry-After
+ # must raise immediately, never sleeping on the request thread.
+ mock_session = MockSession.return_value
+ mock_session.headers = {}
+ mock_session.prepare_request.return_value = MagicMock()
+
+ rate_limited = _make_response({"error": "rate limited"}, status_code=429)
+ rate_limited.url = "https://api.example.com/items"
+ rate_limited.headers["Retry-After"] = "300"
+ mock_session.send.return_value = rate_limited
+
+ client = RESTClient(base_url="https://api.example.com", max_retry_attempts=1)
+ with pytest.raises(RESTClientRetryableError):
+ list(client.paginate(path="/items", paginator=SinglePagePaginator()))
+
+ assert mock_session.send.call_count == 1
+ mock_sleep.assert_not_called()
+
@patch("tenacity.nap.time.sleep")
@patch(
"products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client.make_tracked_session"
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py
index 76285bdf618e..5930c8a41fa6 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py
@@ -130,6 +130,9 @@ class ClientConfig(TypedDict, total=False):
# Optional pre-built session. Sources that need SSRF-guarding or other custom
# transport behaviour pass one here; left unset, RESTClient builds a tracked session.
session: Optional[Session]
+ # Cap on retry attempts per request. Left unset, RESTClient uses its default;
+ # the inline preview sets 1 so a rate-limited endpoint errors instead of sleeping.
+ max_retries: int
class IncrementalArgs(TypedDict, total=False):
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py
index 20cceedd4307..b54b18208782 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py
@@ -1,14 +1,15 @@
import copy
import json
import graphlib
+from collections.abc import Callable
from datetime import date
from typing import Any, Literal, NamedTuple, Optional, cast
-from urllib.parse import urlparse
+from urllib.parse import quote, quote_plus, urlparse
import structlog
from jsonpath_ng.exceptions import JSONPathError
from pydantic import BaseModel, ConfigDict, Field, ValidationError, model_validator
-from requests import Response
+from requests import PreparedRequest, Response
from urllib3.util.retry import Retry
from posthog.schema import (
@@ -28,7 +29,11 @@ from products.warehouse_sources.backend.temporal.data_imports.pipelines.pipeline
SourceResponse,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import FieldType, SimpleSource
-from products.warehouse_sources.backend.temporal.data_imports.sources.common.http import make_tracked_session
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.http import (
+ make_tracked_adapter,
+ make_tracked_session,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.http.transport import _NoRedirectSession
from products.warehouse_sources.backend.temporal.data_imports.sources.common.mixins import _is_host_safe
from products.warehouse_sources.backend.temporal.data_imports.sources.common.registry import SourceRegistry
from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source import (
@@ -85,6 +90,22 @@ MAX_MANIFEST_RESOURCES = 50
# Enforced in the external_data_source create endpoint.
MAX_CUSTOM_SOURCES_PER_TEAM = 5
+# Bounds on the create-time preview / test-read. Like the probe, preview runs
+# inline on the API request thread, so the row count is hard-capped: the default
+# is enough to eyeball data_selector / primary_key / cursor_path, and the max
+# stops a preview from buffering a large page into worker memory.
+PREVIEW_DEFAULT_ROWS = 10
+PREVIEW_MAX_ROWS = 50
+# Cap the parent rows a fan-out preview walks: the engine fires one child request
+# per parent, and empty child pages slip past the row cap (see `preview_resource`).
+PREVIEW_MAX_FANOUT_PARENTS = 10
+# Total decoded response bytes one preview may parse, across all its requests — a
+# per-response cap wouldn't bound a fan-out's many pages (see `_PreviewSession`).
+PREVIEW_MAX_TOTAL_BODY_BYTES = 20 * 1024 * 1024
+# Compressed bytes pulled per streamed read while enforcing that budget; small so a
+# bomb can inflate at most one chunk's worth past the budget before we abort.
+PREVIEW_READ_CHUNK_BYTES = 64 * 1024
+
class ManifestValidationError(ValueError):
"""Raised when the user-provided manifest doesn't conform to RESTAPIConfig."""
@@ -818,6 +839,259 @@ class CustomSource(SimpleSource[CustomSourceConfig]):
sort_mode=sort_mode,
)
+ def preview_resource(
+ self,
+ config: CustomSourceConfig,
+ team_id: int,
+ resource_name: str,
+ max_rows: int = PREVIEW_DEFAULT_ROWS,
+ ) -> "PreviewResult":
+ """Fetch a bounded first page of rows for one manifest resource.
+
+ Lets a manifest author verify ``data_selector`` / ``primary_key`` /
+ ``cursor_path`` against live rows before creating a source. Reuses the
+ sync path's manifest assembly, SSRF host validation, fan-out chain, and
+ REST engine, but: pins every resource to a single page, strips all
+ incremental config (preview is an unconditional first read, so the
+ returned rows still carry the cursor field for inspection), and injects
+ a no-redirect, timeout-bounded session so the inline read can't hang.
+ Iterating the lazy engine resource and stopping at ``max_rows`` bounds a
+ fan-out child's per-parent request volume.
+
+ Structural / graph / URL problems raise ``ManifestValidationError`` or
+ ``ValueError`` (the API turns these into 400s); a live fetch failure is
+ returned in ``error`` so the caller can iterate. The assembled manifest
+ carries the injected credential and is never returned — only rows.
+ """
+ max_rows = max(1, min(max_rows, PREVIEW_MAX_ROWS))
+
+ manifest = self._assemble_manifest(config)
+ _validate_resource_graph(manifest)
+ _validate_incremental_configs(manifest)
+
+ ok, err = validate_manifest_urls(manifest, team_id)
+ if not ok:
+ raise ManifestValidationError(err or "Manifest URL validation failed")
+
+ chain = _fanout_chain(manifest, resource_name)
+
+ client = manifest["client"]
+ try:
+ preview_auth = create_auth(client.get("auth"))
+ except (ValueError, TypeError) as exc:
+ raise ManifestValidationError(f"Invalid auth configuration: {exc}") from exc
+ secret_values = auth_secret_values(preview_auth)
+
+ engine_resources = [
+ _with_single_page_paginator(_without_incremental_config(resource))
+ for resource in (*chain.ancestors, chain.child)
+ ]
+ engine_manifest = cast(
+ RESTAPIConfig,
+ {
+ **manifest,
+ "resources": engine_resources,
+ "client": {
+ **client,
+ "session": _build_preview_session(secret_values),
+ # One attempt only — a rate-limited endpoint must surface an error
+ # inline, not sleep on `Retry-After` and tie up the request thread.
+ "max_retries": 1,
+ },
+ },
+ )
+
+ try:
+ resources = rest_api_resources(
+ engine_manifest,
+ team_id=team_id,
+ job_id="custom-source-preview",
+ db_incremental_field_last_value=None,
+ )
+ except ValueError as exc:
+ # Deterministic build-time config errors the create-time checks can't
+ # see (e.g. include_from_parent on a resource with no resolve param).
+ raise ManifestValidationError(str(exc)) from exc
+
+ # Cap how many parent rows each fan-out ancestor emits. The engine issues one
+ # child request per parent row, and empty child pages are dropped before the
+ # row reader sees them — so the request bound has to live on the parent, not on
+ # pages collected downstream.
+ ancestor_names = {ancestor["name"] for ancestor in chain.ancestors}
+ for engine_resource in resources:
+ if getattr(engine_resource, "name", None) in ancestor_names:
+ engine_resource.add_filter(_keep_first_n(PREVIEW_MAX_FANOUT_PARENTS))
+
+ resource = next((r for r in resources if getattr(r, "name", None) == resource_name), None)
+ if resource is None:
+ raise ManifestValidationError(f"Resource {resource_name!r} was not produced by the REST engine")
+
+ try:
+ rows = _collect_preview_rows(resource, max_rows)
+ except Exception as exc:
+ return PreviewResult(rows=[], row_count=0, columns=[], error=_redact_secrets(str(exc), secret_values))
+
+ return PreviewResult(rows=rows, row_count=len(rows), columns=_infer_columns(rows), error=None)
+
+
+class PreviewResult(NamedTuple):
+ """Outcome of a single-resource preview read. ``error`` is set only for a
+ live fetch failure — structural problems raise instead."""
+
+ rows: list[dict[str, Any]]
+ row_count: int
+ columns: list[dict[str, str]]
+ error: str | None
+
+
+class PreviewResponseTooLargeError(Exception):
+ """A preview's cumulative response bytes exceeded ``PREVIEW_MAX_TOTAL_BODY_BYTES``."""
+
+
+class _PreviewSession(_NoRedirectSession):
+ """No-redirect session for the inline preview read, bounded on time and size.
+
+ Pins a session-level timeout (``RESTClient.send()`` passes none, so a stalled
+ upstream can't hang the request thread) and caps the response bytes parsed via a
+ budget shared across the preview — one session serves one preview. See
+ ``_read_within_budget`` for the size enforcement.
+ """
+
+ def __init__(self) -> None:
+ super().__init__()
+ self._body_budget = PREVIEW_MAX_TOTAL_BODY_BYTES
+
+ def send(self, request: PreparedRequest, **kwargs: Any) -> Response:
+ kwargs.setdefault("timeout", (PROBE_CONNECT_TIMEOUT, PROBE_READ_TIMEOUT))
+ kwargs["stream"] = True
+ response = super().send(request, **kwargs)
+ try:
+ body = self._read_within_budget(response)
+ finally:
+ response.close()
+ response._content = body
+ response._content_consumed = True # type: ignore[attr-defined]
+ return response
+
+ def _read_within_budget(self, response: Response) -> bytes:
+ # Stream *decoded* chunks and stop the instant the running total crosses the
+ # budget. A single read(decode_content=True) would inflate the whole compressed
+ # body at once — a gzipped page decompresses fully before any size check — so a
+ # bomb is bounded only by decoding incrementally and aborting early.
+ chunks: list[bytes] = []
+ decoded = 0
+ for chunk in response.raw.stream(PREVIEW_READ_CHUNK_BYTES, decode_content=True):
+ decoded += len(chunk)
+ if decoded > self._body_budget:
+ raise PreviewResponseTooLargeError(
+ f"Preview response bodies exceeded the {PREVIEW_MAX_TOTAL_BODY_BYTES}-byte budget"
+ )
+ chunks.append(chunk)
+ self._body_budget -= decoded
+ return b"".join(chunks)
+
+
+def _build_preview_session(redact_values: tuple[str, ...]) -> _PreviewSession:
+ """A tracked preview session: no transport retries, credentials registered
+ for value-based redaction (auth may be injected under a manifest-chosen
+ param/header the denylist can't anticipate)."""
+ session = _PreviewSession()
+ adapter = make_tracked_adapter(retry=Retry(total=0), redact_values=redact_values)
+ session.mount("https://", adapter)
+ session.mount("http://", adapter)
+ return session
+
+
+def _with_single_page_paginator(resource: dict[str, Any]) -> dict[str, Any]:
+ """Return a copy of ``resource`` pinned to a single page, so a preview reads
+ exactly one page per resource regardless of the manifest's paginator."""
+ endpoint = resource.get("endpoint")
+ if isinstance(endpoint, str):
+ endpoint = {"path": endpoint}
+ elif not isinstance(endpoint, dict):
+ endpoint = {}
+ return {**resource, "endpoint": {**endpoint, "paginator": {"type": "single_page"}}}
+
+
+def _keep_first_n(n: int) -> Callable[[dict[str, Any]], bool]:
+ """A stateful filter that keeps the first ``n`` rows and drops the rest.
+
+ Applied to a fan-out ancestor so the child fans out over at most ``n`` parent
+ rows — the request bound the row reader can't enforce, since empty child pages
+ never reach it.
+ """
+ seen = 0
+
+ def keep(_row: dict[str, Any]) -> bool:
+ nonlocal seen
+ if seen >= n:
+ return False
+ seen += 1
+ return True
+
+ return keep
+
+
+def _collect_preview_rows(resource: Any, max_rows: int) -> list[dict[str, Any]]:
+ """Flatten the engine resource's pages into at most ``max_rows`` records.
+
+ Iterating a :class:`Resource` yields pages (``list[dict]``) lazily, so
+ returning early abandons the generator and stops it issuing further requests.
+ A fan-out child's request volume is bounded upstream by capping its parent
+ rows (see ``preview_resource``); a single-page top-level resource issues one
+ request regardless.
+ """
+ rows: list[dict[str, Any]] = []
+ for page in resource:
+ for item in page:
+ if isinstance(item, dict):
+ rows.append(item)
+ if len(rows) >= max_rows:
+ return rows
+ return rows
+
+
+def _json_type_label(value: Any) -> str:
+ # bool is a subclass of int, so it must be checked first.
+ if value is None:
+ return "null"
+ if isinstance(value, bool):
+ return "boolean"
+ if isinstance(value, int):
+ return "integer"
+ if isinstance(value, float):
+ return "number"
+ if isinstance(value, str):
+ return "string"
+ if isinstance(value, list):
+ return "array"
+ if isinstance(value, dict):
+ return "object"
+ return "string"
+
+
+def _infer_columns(rows: list[dict[str, Any]]) -> list[dict[str, str]]:
+ """Advisory column list for the previewed rows — each key seen (first-seen
+ order), typed from the first non-null value. Helps the caller sanity-check
+ data_selector / primary_key / cursor_path against real data."""
+ columns: dict[str, str] = {}
+ for row in rows:
+ for key, value in row.items():
+ if key not in columns or columns[key] == "null":
+ columns[key] = _json_type_label(value)
+ return [{"name": name, "type": type_label} for name, type_label in columns.items()]
+
+
+def _redact_secrets(text: str, secrets: tuple[str, ...]) -> str:
+ # Redact the raw secret and its URL-encoded forms: a key in a query param is
+ # percent-encoded in `response.url`, which an HTTPError carries verbatim.
+ for secret in secrets:
+ if not secret:
+ continue
+ for variant in dict.fromkeys((secret, quote(secret, safe=""), quote_plus(secret))):
+ text = text.replace(variant, "***")
+ return text
+
def _read_capped_text(response: Response) -> str:
"""Read at most ``PROBE_ERROR_SNIPPET_BYTES`` of a streamed body for an error snippet.
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py
index 0fd910ecff52..d5fb29fc5c4a 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py
@@ -3,11 +3,13 @@ import gzip
import json
from datetime import UTC, datetime
from typing import Any, cast
+from urllib.parse import quote
from unittest.mock import MagicMock, patch
from django.test import SimpleTestCase, override_settings
+import requests
from parameterized import parameterized
from requests import Response
from urllib3.response import HTTPResponse
@@ -19,12 +21,20 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.res
)
from products.warehouse_sources.backend.temporal.data_imports.sources.custom.source import (
MAX_MANIFEST_RESOURCES,
+ PREVIEW_MAX_FANOUT_PARENTS,
+ PREVIEW_MAX_ROWS,
+ PROBE_CONNECT_TIMEOUT,
PROBE_MAX_RESOURCES,
+ PROBE_READ_TIMEOUT,
CustomSource,
FanoutChain,
ManifestValidationError,
+ PreviewResponseTooLargeError,
_fanout_chain,
+ _json_type_label,
+ _PreviewSession,
_read_capped_text,
+ _redact_secrets,
_validate_resource_graph,
manifest_request_hosts,
validate_manifest_structure,
@@ -911,6 +921,41 @@ def _fake_resource(name: str) -> MagicMock:
return resource
+class _PageResource:
+ """Iterable stand-in for an engine Resource: yields preset pages (list[dict]),
+ applying any registered ``add_filter`` predicates so the preview's parent cap
+ is exercised the same way the real Resource would apply it."""
+
+ def __init__(self, name: str, pages: list[list[dict[str, Any]]]) -> None:
+ self.name = name
+ self._pages = pages
+ self._filters: list[Any] = []
+
+ def add_filter(self, fn: Any) -> "_PageResource":
+ self._filters.append(fn)
+ return self
+
+ def __iter__(self) -> Any:
+ for page in self._pages:
+ yield [item for item in page if all(f(item) for f in self._filters)]
+
+
+class _CountingResource:
+ """Engine Resource that yields one-row pages lazily and records how many rows
+ it produced, so a test can prove preview abandons the generator at the cap
+ instead of draining it."""
+
+ def __init__(self, name: str, total_rows: int) -> None:
+ self.name = name
+ self.total_rows = total_rows
+ self.produced = 0
+
+ def __iter__(self) -> Any:
+ for index in range(self.total_rows):
+ self.produced = index + 1
+ yield [{"id": index}]
+
+
def _break_unknown_parent(m: dict) -> None:
m["resources"][1]["endpoint"]["params"]["form_id"]["resource"] = "nonexistent"
@@ -1522,3 +1567,308 @@ class TestCustomSourceIncrementalDatetimeFormat(SimpleTestCase):
child_params = next((p for p in captured if "since" in p), {})
assert child_params.get("since") == "2026-06-08T12:53:34Z"
+
+
+def _apikey_manifest() -> dict:
+ """A minimal manifest whose auth is an api_key in a query param, so the
+ injected secret is registered for value-based redaction."""
+ manifest = _minimal_manifest()
+ manifest["client"]["auth"] = {"type": "api_key", "name": "key", "location": "query"}
+ return manifest
+
+
+class TestPreviewSession(SimpleTestCase):
+ def test_send_pins_no_redirect_streams_and_default_timeout(self):
+ prepared = requests.Request("GET", "https://acme.example.com/").prepare()
+ response = Response()
+ response.status_code = 200
+ response.raw = MagicMock()
+ response.raw.stream.return_value = iter([b"{}"])
+
+ with patch.object(requests.Session, "send", return_value=response) as parent_send:
+ _PreviewSession().send(prepared)
+
+ forwarded = parent_send.call_args.kwargs
+ assert forwarded["allow_redirects"] is False
+ assert forwarded["stream"] is True
+ assert forwarded["timeout"] == (PROBE_CONNECT_TIMEOUT, PROBE_READ_TIMEOUT)
+
+
+class TestJsonTypeLabel(SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("null", None, "null"),
+ ("boolean", True, "boolean"),
+ ("integer", 7, "integer"),
+ ("number", 1.5, "number"),
+ ("string", "x", "string"),
+ ("array", [1, 2], "array"),
+ ("object", {"k": 1}, "object"),
+ ("unknown_falls_back_to_string", (1, 2), "string"),
+ ]
+ )
+ def test_labels_each_json_type(self, _name, value, expected):
+ assert _json_type_label(value) == expected
+
+
+class TestCustomSourcePreviewResource(SimpleTestCase):
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_returns_rows_and_inferred_columns(self, mock_resources):
+ mock_resources.return_value = [
+ _PageResource("users", [[{"id": 1, "name": "a", "active": True}, {"id": 2, "name": "b", "active": None}]])
+ ]
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="abc")
+ result = source.preview_resource(config, team_id=999, resource_name="users")
+
+ assert result.error is None
+ assert result.row_count == 2
+ assert result.rows[0]["id"] == 1
+ assert {column["name"]: column["type"] for column in result.columns} == {
+ "id": "integer",
+ "name": "string",
+ "active": "boolean",
+ }
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_column_type_uses_first_non_null_value(self, mock_resources):
+ mock_resources.return_value = [_PageResource("users", [[{"score": None}, {"score": 7}]])]
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="abc")
+ result = source.preview_resource(config, team_id=999, resource_name="users")
+
+ assert {column["name"]: column["type"] for column in result.columns} == {"score": "integer"}
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_row_cap_stops_generator_early(self, mock_resources):
+ resource = _CountingResource("users", total_rows=100)
+ mock_resources.return_value = [resource]
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="abc")
+ result = source.preview_resource(config, team_id=999, resource_name="users", max_rows=5)
+
+ assert result.row_count == 5
+ assert resource.produced == 5
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_max_rows_clamped_to_hard_cap(self, mock_resources):
+ one_big_page = [[{"id": index} for index in range(PREVIEW_MAX_ROWS + 50)]]
+ mock_resources.return_value = [_PageResource("users", one_big_page)]
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="abc")
+ result = source.preview_resource(config, team_id=999, resource_name="users", max_rows=PREVIEW_MAX_ROWS + 50)
+
+ assert result.row_count == PREVIEW_MAX_ROWS
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_engine_manifest_is_single_page_incremental_stripped_session_injected(self, mock_resources):
+ mock_resources.return_value = [_PageResource("users", [[]])]
+ manifest = _minimal_manifest()
+ manifest["resources"][0]["endpoint"]["incremental"] = {"cursor_path": "updated_at", "start_param": "since"}
+ manifest["resources"][0]["endpoint"]["paginator"] = {"type": "offset", "limit": 100}
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(manifest), auth_token="abc")
+ source.preview_resource(config, team_id=999, resource_name="users")
+
+ engine_manifest = mock_resources.call_args.args[0]
+ endpoint = engine_manifest["resources"][0]["endpoint"]
+ assert endpoint["paginator"] == {"type": "single_page"}
+ assert "incremental" not in endpoint
+ assert isinstance(engine_manifest["client"]["session"], _PreviewSession)
+ assert engine_manifest["client"]["max_retries"] == 1
+ assert mock_resources.call_args.kwargs["db_incremental_field_last_value"] is None
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source._is_host_safe",
+ return_value=(False, "blocked: internal host"),
+ )
+ def test_rejects_unsafe_host(self, _mock):
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="abc")
+ with self.assertRaises(ManifestValidationError):
+ source.preview_resource(config, team_id=999, resource_name="users")
+
+ def test_unknown_resource_raises_value_error(self):
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="abc")
+ with self.assertRaises(ValueError):
+ source.preview_resource(config, team_id=999, resource_name="does_not_exist")
+
+ def test_invalid_json_raises_manifest_validation_error(self):
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json="{not json}")
+ with self.assertRaises(ManifestValidationError):
+ source.preview_resource(config, team_id=999, resource_name="users")
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_fanout_child_runs_ancestors_full_scan(self, mock_resources):
+ mock_resources.return_value = [
+ _PageResource("forms", [[{"id": 1}]]),
+ _PageResource("responses", [[{"token": "t1"}]]),
+ ]
+ manifest = _fanout_manifest()
+ manifest["resources"][0]["endpoint"]["incremental"] = {"cursor_path": "updated_at", "start_param": "since"}
+ manifest["resources"][1]["endpoint"]["incremental"] = {"cursor_path": "submitted_at", "start_param": "since"}
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(manifest), auth_token="abc")
+ result = source.preview_resource(config, team_id=999, resource_name="responses")
+
+ engine_resources = mock_resources.call_args.args[0]["resources"]
+ assert [resource["name"] for resource in engine_resources] == ["forms", "responses"]
+ for resource in engine_resources:
+ assert "incremental" not in resource["endpoint"]
+ assert resource["endpoint"]["paginator"] == {"type": "single_page"}
+ assert result.rows == [{"token": "t1"}]
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source._build_preview_session")
+ def test_fanout_empty_child_caps_parent_requests_through_real_engine(self, mock_build_session):
+ # End-to-end through the real engine: a parent page far larger than the cap,
+ # every child resolving empty. Empty child pages are dropped before the row
+ # reader sees them, so only the parent cap keeps the per-parent child requests
+ # bounded — the regression a fake-page stand-in can't catch.
+ def _response(body: dict) -> Response:
+ resp = Response()
+ resp.status_code = 200
+ resp._content = json.dumps(body).encode()
+ resp.headers["Content-Type"] = "application/json"
+ return resp
+
+ sent_urls: list[str] = []
+
+ def _send(prepared):
+ sent_urls.append(prepared.url)
+ if prepared.url.endswith("/forms"):
+ return _response({"items": [{"id": f"f{index}"} for index in range(PREVIEW_MAX_FANOUT_PARENTS + 20)]})
+ return _response({"items": []})
+
+ session = MagicMock()
+ session.headers = {}
+ session.prepare_request.side_effect = lambda request: request
+ session.send.side_effect = _send
+ mock_build_session.return_value = session
+
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_fanout_manifest()), auth_token="abc")
+ result = source.preview_resource(config, team_id=999, resource_name="responses")
+
+ assert result.row_count == 0
+ child_requests = [url for url in sent_urls if "/responses" in url]
+ assert len(child_requests) == PREVIEW_MAX_FANOUT_PARENTS
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source._is_host_safe",
+ side_effect=lambda hostname, team_id: (hostname == "api.example.com", "blocked: internal host"),
+ )
+ def test_rejects_resource_resolving_to_new_internal_host(self, _mock_safe, mock_resources):
+ manifest = _minimal_manifest()
+ manifest["resources"][0]["endpoint"]["path"] = "https://169.254.169.254/users"
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(manifest), auth_token="abc")
+ with self.assertRaises(ManifestValidationError):
+ source.preview_resource(config, team_id=999, resource_name="users")
+
+ mock_resources.assert_not_called()
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_live_fetch_error_is_returned_and_secret_redacted(self, mock_resources):
+ class _Boom:
+ name = "users"
+
+ def __iter__(self) -> Any:
+ raise RuntimeError("connect failed for https://api.example.com/users?key=supersecret")
+
+ mock_resources.return_value = [_Boom()]
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_apikey_manifest()), auth_api_key="supersecret")
+ result = source.preview_resource(config, team_id=999, resource_name="users")
+
+ assert result.rows == []
+ assert result.row_count == 0
+ assert result.error is not None
+ assert "supersecret" not in result.error
+ assert "***" in result.error
+
+ def test_redact_secrets_redacts_url_encoded_credential(self):
+ secret = "ab/cd+ef=gh"
+ text = f"HTTPError for https://api.example.com/users?key={quote(secret, safe='')}"
+ redacted = _redact_secrets(text, (secret,))
+
+ assert quote(secret, safe="") not in redacted
+ assert "***" in redacted
+
+ @staticmethod
+ def _streamed_response(body_size: int) -> Response:
+ # raw.stream(amt) yields the decoded body in <=amt-byte chunks, like urllib3.
+ response = Response()
+ response.status_code = 200
+ response.raw = MagicMock()
+ payload = b"x" * body_size
+ response.raw.stream.side_effect = lambda amt, **kwargs: (
+ payload[i : i + amt] for i in range(0, len(payload), amt)
+ )
+ return response
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.PREVIEW_READ_CHUNK_BYTES", 16
+ )
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.PREVIEW_MAX_TOTAL_BODY_BYTES",
+ 100,
+ )
+ def test_preview_session_aborts_oversized_body_without_full_read(self):
+ # A body far over budget must raise AND stop mid-stream — never inflate the
+ # whole thing (the failure mode of a single decode-everything read).
+ yielded = {"chunks": 0}
+
+ def stream(amt, **kwargs):
+ for _ in range(100):
+ yielded["chunks"] += 1
+ yield b"x" * amt
+
+ response = Response()
+ response.status_code = 200
+ response.raw = MagicMock()
+ response.raw.stream.side_effect = stream
+ with patch.object(requests.Session, "send", return_value=response):
+ with self.assertRaises(PreviewResponseTooLargeError):
+ _PreviewSession().send(MagicMock())
+
+ assert yielded["chunks"] <= 100 // 16 + 1
+
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.PREVIEW_READ_CHUNK_BYTES", 16
+ )
+ @patch(
+ "products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.PREVIEW_MAX_TOTAL_BODY_BYTES",
+ 100,
+ )
+ def test_preview_session_enforces_budget_across_requests(self):
+ # Each response is under the budget on its own, but together they exceed it:
+ # the budget is the whole preview's, not per response.
+ responses = [self._streamed_response(60), self._streamed_response(60)]
+ with patch.object(requests.Session, "send", side_effect=responses):
+ session = _PreviewSession()
+ session.send(MagicMock())
+ with self.assertRaises(PreviewResponseTooLargeError):
+ session.send(MagicMock())
+
+ def test_preview_session_returns_capped_body(self):
+ body = b'{"items": [{"id": 1}]}'
+ within_cap = Response()
+ within_cap.status_code = 200
+ within_cap.raw = MagicMock()
+ within_cap.raw.stream.side_effect = lambda amt, **kwargs: (body[i : i + amt] for i in range(0, len(body), amt))
+ with patch.object(requests.Session, "send", return_value=within_cap):
+ response = _PreviewSession().send(MagicMock())
+
+ assert response.json() == {"items": [{"id": 1}]}
+
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_credential_never_appears_in_result(self, mock_resources):
+ mock_resources.return_value = [_PageResource("users", [[{"id": 1}]])]
+ source = CustomSource()
+ config = CustomSourceConfig(manifest_json=json.dumps(_minimal_manifest()), auth_token="topsecret-token")
+ result = source.preview_resource(config, team_id=999, resource_name="users")
+
+ assert "topsecret-token" not in json.dumps(result._asdict())
diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.ts
index 701813528385..d919f21efd71 100644
--- a/products/warehouse_sources/frontend/generated/api.schemas.ts
+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts
@@ -3260,6 +3260,690 @@ export interface DatabaseSchemaRequestApi {
source_type: ExternalDataSourceTypeEnumApi
}
+/**
+ * Source config as flat keys. For source_type 'Custom': 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the manifest's declared auth type — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic). Secrets stay in these auth_* keys, never inline in the manifest.
+ */
+export type SourcePreviewRequestApiPayload = { [key: string]: unknown }
+
+export interface SourcePreviewRequestApi {
+ /** The source type to preview. Only 'Custom' (a user-defined REST API) is supported today.
+ *
+ * * `Ashby` - Ashby
+ * * `Supabase` - Supabase
+ * * `CustomerIO` - CustomerIO
+ * * `Github` - Github
+ * * `Stripe` - Stripe
+ * * `Hubspot` - Hubspot
+ * * `Postgres` - Postgres
+ * * `Zendesk` - Zendesk
+ * * `Snowflake` - Snowflake
+ * * `Salesforce` - Salesforce
+ * * `MySQL` - MySQL
+ * * `MongoDB` - MongoDB
+ * * `MSSQL` - MSSQL
+ * * `Vitally` - Vitally
+ * * `BigQuery` - BigQuery
+ * * `Chargebee` - Chargebee
+ * * `Clerk` - Clerk
+ * * `GoogleAds` - GoogleAds
+ * * `GoogleSearchConsole` - GoogleSearchConsole
+ * * `TemporalIO` - TemporalIO
+ * * `DoIt` - DoIt
+ * * `GoogleSheets` - GoogleSheets
+ * * `MetaAds` - MetaAds
+ * * `Klaviyo` - Klaviyo
+ * * `Mailchimp` - Mailchimp
+ * * `Braze` - Braze
+ * * `Mailjet` - Mailjet
+ * * `Redshift` - Redshift
+ * * `Polar` - Polar
+ * * `RevenueCat` - RevenueCat
+ * * `LinkedinAds` - LinkedinAds
+ * * `RedditAds` - RedditAds
+ * * `TikTokAds` - TikTokAds
+ * * `BingAds` - BingAds
+ * * `Shopify` - Shopify
+ * * `Attio` - Attio
+ * * `SnapchatAds` - SnapchatAds
+ * * `Linear` - Linear
+ * * `Intercom` - Intercom
+ * * `Amplitude` - Amplitude
+ * * `Mixpanel` - Mixpanel
+ * * `Jira` - Jira
+ * * `ActiveCampaign` - ActiveCampaign
+ * * `Marketo` - Marketo
+ * * `Adjust` - Adjust
+ * * `AppsFlyer` - AppsFlyer
+ * * `Freshdesk` - Freshdesk
+ * * `GoogleAnalytics` - GoogleAnalytics
+ * * `Pipedrive` - Pipedrive
+ * * `SendGrid` - SendGrid
+ * * `Slack` - Slack
+ * * `PagerDuty` - PagerDuty
+ * * `Asana` - Asana
+ * * `Notion` - Notion
+ * * `Airtable` - Airtable
+ * * `Greenhouse` - Greenhouse
+ * * `BambooHR` - BambooHR
+ * * `Lever` - Lever
+ * * `GitLab` - GitLab
+ * * `Datadog` - Datadog
+ * * `Sentry` - Sentry
+ * * `Pendo` - Pendo
+ * * `FullStory` - FullStory
+ * * `AmazonAds` - AmazonAds
+ * * `PinterestAds` - PinterestAds
+ * * `AppleSearchAds` - AppleSearchAds
+ * * `QuickBooks` - QuickBooks
+ * * `Xero` - Xero
+ * * `NetSuite` - NetSuite
+ * * `WooCommerce` - WooCommerce
+ * * `BigCommerce` - BigCommerce
+ * * `PayPal` - PayPal
+ * * `Square` - Square
+ * * `Zoom` - Zoom
+ * * `Trello` - Trello
+ * * `Monday` - Monday
+ * * `ClickUp` - ClickUp
+ * * `Confluence` - Confluence
+ * * `Recurly` - Recurly
+ * * `SalesLoft` - SalesLoft
+ * * `Outreach` - Outreach
+ * * `Gong` - Gong
+ * * `Calendly` - Calendly
+ * * `Typeform` - Typeform
+ * * `Iterable` - Iterable
+ * * `ZohoCRM` - ZohoCRM
+ * * `Close` - Close
+ * * `Oracle` - Oracle
+ * * `DynamoDB` - DynamoDB
+ * * `Elasticsearch` - Elasticsearch
+ * * `Kafka` - Kafka
+ * * `LaunchDarkly` - LaunchDarkly
+ * * `Braintree` - Braintree
+ * * `Recharge` - Recharge
+ * * `HelpScout` - HelpScout
+ * * `Gorgias` - Gorgias
+ * * `Instagram` - Instagram
+ * * `YouTubeAnalytics` - YouTubeAnalytics
+ * * `FacebookPages` - FacebookPages
+ * * `TwitterAds` - TwitterAds
+ * * `Workday` - Workday
+ * * `ServiceNow` - ServiceNow
+ * * `Pardot` - Pardot
+ * * `Copper` - Copper
+ * * `Front` - Front
+ * * `ChartMogul` - ChartMogul
+ * * `Zuora` - Zuora
+ * * `Paddle` - Paddle
+ * * `CircleCI` - CircleCI
+ * * `CockroachDB` - CockroachDB
+ * * `Firebase` - Firebase
+ * * `AzureBlob` - AzureBlob
+ * * `GoogleDrive` - GoogleDrive
+ * * `OneDrive` - OneDrive
+ * * `SharePoint` - SharePoint
+ * * `Box` - Box
+ * * `SFTP` - SFTP
+ * * `MicrosoftTeams` - MicrosoftTeams
+ * * `Aircall` - Aircall
+ * * `Webflow` - Webflow
+ * * `Okta` - Okta
+ * * `Auth0` - Auth0
+ * * `Productboard` - Productboard
+ * * `Smartsheet` - Smartsheet
+ * * `Wrike` - Wrike
+ * * `Plaid` - Plaid
+ * * `SurveyMonkey` - SurveyMonkey
+ * * `Eventbrite` - Eventbrite
+ * * `RingCentral` - RingCentral
+ * * `Twilio` - Twilio
+ * * `Freshsales` - Freshsales
+ * * `Shortcut` - Shortcut
+ * * `ConvertKit` - ConvertKit
+ * * `Drip` - Drip
+ * * `CampaignMonitor` - CampaignMonitor
+ * * `MailerLite` - MailerLite
+ * * `Omnisend` - Omnisend
+ * * `Brevo` - Brevo
+ * * `Postmark` - Postmark
+ * * `Granola` - Granola
+ * * `BuildBetter` - BuildBetter
+ * * `Convex` - Convex
+ * * `ClickHouse` - ClickHouse
+ * * `Plain` - Plain
+ * * `Resend` - Resend
+ * * `PgAnalyze` - PgAnalyze
+ * * `WorkOS` - WorkOS
+ * * `AmazonS3` - AmazonS3
+ * * `GoogleCloudStorage` - GoogleCloudStorage
+ * * `Databricks` - Databricks
+ * * `Dynamics365` - Dynamics365
+ * * `SalesforceMarketingCloud` - SalesforceMarketingCloud
+ * * `Db2` - Db2
+ * * `Heap` - Heap
+ * * `AdobeAnalytics` - AdobeAnalytics
+ * * `Matomo` - Matomo
+ * * `Optimizely` - Optimizely
+ * * `Adyen` - Adyen
+ * * `GoCardless` - GoCardless
+ * * `Mollie` - Mollie
+ * * `CheckoutCom` - CheckoutCom
+ * * `Branch` - Branch
+ * * `Criteo` - Criteo
+ * * `Outbrain` - Outbrain
+ * * `Taboola` - Taboola
+ * * `AdRoll` - AdRoll
+ * * `DisplayVideo360` - DisplayVideo360
+ * * `GoogleAdManager` - GoogleAdManager
+ * * `CampaignManager360` - CampaignManager360
+ * * `SearchAds360` - SearchAds360
+ * * `AdobeCommerce` - AdobeCommerce
+ * * `AmazonSellingPartner` - AmazonSellingPartner
+ * * `Ebay` - Ebay
+ * * `Commercetools` - Commercetools
+ * * `LightspeedRetail` - LightspeedRetail
+ * * `ShipStation` - ShipStation
+ * * `ConstantContact` - ConstantContact
+ * * `Mailgun` - Mailgun
+ * * `Eloqua` - Eloqua
+ * * `Sailthru` - Sailthru
+ * * `Ortto` - Ortto
+ * * `Attentive` - Attentive
+ * * `Kustomer` - Kustomer
+ * * `Dixa` - Dixa
+ * * `Gladly` - Gladly
+ * * `Qualtrics` - Qualtrics
+ * * `Delighted` - Delighted
+ * * `AzureDevOps` - AzureDevOps
+ * * `Rollbar` - Rollbar
+ * * `Opsgenie` - Opsgenie
+ * * `IncidentIo` - IncidentIo
+ * * `Pingdom` - Pingdom
+ * * `Cloudflare` - Cloudflare
+ * * `CosmosDB` - CosmosDB
+ * * `PlanetScale` - PlanetScale
+ * * `SapHana` - SapHana
+ * * `Rippling` - Rippling
+ * * `HiBob` - HiBob
+ * * `Personio` - Personio
+ * * `Deel` - Deel
+ * * `AdpWorkforceNow` - AdpWorkforceNow
+ * * `Paylocity` - Paylocity
+ * * `Gusto` - Gusto
+ * * `CultureAmp` - CultureAmp
+ * * `Lattice` - Lattice
+ * * `SageIntacct` - SageIntacct
+ * * `FreshBooks` - FreshBooks
+ * * `Expensify` - Expensify
+ * * `Ramp` - Ramp
+ * * `Brex` - Brex
+ * * `Coupa` - Coupa
+ * * `SapConcur` - SapConcur
+ * * `Apollo` - Apollo
+ * * `Crunchbase` - Crunchbase
+ * * `ZoomInfo` - ZoomInfo
+ * * `Clari` - Clari
+ * * `Chorus` - Chorus
+ * * `Coda` - Coda
+ * * `Guru` - Guru
+ * * `Dropbox` - Dropbox
+ * * `Docusign` - Docusign
+ * * `PandaDoc` - PandaDoc
+ * * `SapErp` - SapErp
+ * * `SapSuccessFactors` - SapSuccessFactors
+ * * `OracleEbs` - OracleEbs
+ * * `OracleFusion` - OracleFusion
+ * * `AmazonSNS` - AmazonSNS
+ * * `AmazonEventBridge` - AmazonEventBridge
+ * * `AmazonSQS` - AmazonSQS
+ * * `AmazonKinesis` - AmazonKinesis
+ * * `AmazonCloudWatch` - AmazonCloudWatch
+ * * `OpenAIAds` - OpenAIAds
+ * * `OneHundredMs` - OneHundredMs
+ * * `SevenShifts` - SevenShifts
+ * * `AcuityScheduling` - AcuityScheduling
+ * * `AgileCRM` - AgileCRM
+ * * `Aha` - Aha
+ * * `Airbyte` - Airbyte
+ * * `Akeneo` - Akeneo
+ * * `Algolia` - Algolia
+ * * `AlpacaBrokerAPI` - AlpacaBrokerAPI
+ * * `ApifyDataset` - ApifyDataset
+ * * `Appcues` - Appcues
+ * * `Appfigures` - Appfigures
+ * * `Appfollow` - Appfollow
+ * * `Apptivo` - Apptivo
+ * * `AssemblyAI` - AssemblyAI
+ * * `Awin` - Awin
+ * * `AwsCloudTrail` - AwsCloudTrail
+ * * `AzureTableStorage` - AzureTableStorage
+ * * `Babelforce` - Babelforce
+ * * `Basecamp` - Basecamp
+ * * `Beamer` - Beamer
+ * * `BigMailer` - BigMailer
+ * * `Bluetally` - Bluetally
+ * * `BoldSign` - BoldSign
+ * * `BreezyHR` - BreezyHR
+ * * `Bugsnag` - Bugsnag
+ * * `Buildkite` - Buildkite
+ * * `Bunny` - Bunny
+ * * `Buzzsprout` - Buzzsprout
+ * * `CalCom` - CalCom
+ * * `CallRail` - CallRail
+ * * `Campayn` - Campayn
+ * * `Canny` - Canny
+ * * `CapsuleCRM` - CapsuleCRM
+ * * `CaptainData` - CaptainData
+ * * `CartCom` - CartCom
+ * * `CastorEDC` - CastorEDC
+ * * `Chameleon` - Chameleon
+ * * `Chargedesk` - Chargedesk
+ * * `Chargify` - Chargify
+ * * `Chift` - Chift
+ * * `Churnkey` - Churnkey
+ * * `Cin7` - Cin7
+ * * `CiscoMeraki` - CiscoMeraki
+ * * `Clazar` - Clazar
+ * * `Clockify` - Clockify
+ * * `Clockodo` - Clockodo
+ * * `Cloudbeds` - Cloudbeds
+ * * `Coassemble` - Coassemble
+ * * `Codefresh` - Codefresh
+ * * `Concord` - Concord
+ * * `ConfigCat` - ConfigCat
+ * * `Couchbase` - Couchbase
+ * * `Curve` - Curve
+ * * `Customerly` - Customerly
+ * * `Datascope` - Datascope
+ * * `Dbt` - Dbt
+ * * `Deputy` - Deputy
+ * * `DevinAI` - DevinAI
+ * * `Docuseal` - Docuseal
+ * * `Dolibarr` - Dolibarr
+ * * `Dremio` - Dremio
+ * * `DropboxSign` - DropboxSign
+ * * `Dwolla` - Dwolla
+ * * `EConomic` - EConomic
+ * * `Easypost` - Easypost
+ * * `Easypromos` - Easypromos
+ * * `Elasticemail` - Elasticemail
+ * * `EmailOctopus` - EmailOctopus
+ * * `EmploymentHero` - EmploymentHero
+ * * `Encharge` - Encharge
+ * * `Eventee` - Eventee
+ * * `Eventzilla` - Eventzilla
+ * * `Everhour` - Everhour
+ * * `EZOfficeInventory` - EZOfficeInventory
+ * * `Factorial` - Factorial
+ * * `Fastbill` - Fastbill
+ * * `Fastly` - Fastly
+ * * `Fauna` - Fauna
+ * * `Feishu` - Feishu
+ * * `Fillout` - Fillout
+ * * `Finage` - Finage
+ * * `Firebolt` - Firebolt
+ * * `FireHydrant` - FireHydrant
+ * * `Fleetio` - Fleetio
+ * * `Flexmail` - Flexmail
+ * * `Flexport` - Flexport
+ * * `FloatApp` - FloatApp
+ * * `Flowlu` - Flowlu
+ * * `Formbricks` - Formbricks
+ * * `FreeAgent` - FreeAgent
+ * * `Freightview` - Freightview
+ * * `Freshcaller` - Freshcaller
+ * * `Freshchat` - Freshchat
+ * * `Freshservice` - Freshservice
+ * * `Fulcrum` - Fulcrum
+ * * `GainsightPx` - GainsightPx
+ * * `GitBook` - GitBook
+ * * `Glassfrog` - Glassfrog
+ * * `Goldcast` - Goldcast
+ * * `GoLogin` - GoLogin
+ * * `Grafana` - Grafana
+ * * `GreytHr` - GreytHr
+ * * `Gridly` - Gridly
+ * * `Harness` - Harness
+ * * `Height` - Height
+ * * `Hellobaton` - Hellobaton
+ * * `HighLevel` - HighLevel
+ * * `HoorayHR` - HoorayHR
+ * * `Hubplanner` - Hubplanner
+ * * `Humanitix` - Humanitix
+ * * `Huntr` - Huntr
+ * * `Inflowinventory` - Inflowinventory
+ * * `InforNexus` - InforNexus
+ * * `Insightful` - Insightful
+ * * `Insightly` - Insightly
+ * * `Instatus` - Instatus
+ * * `Intruder` - Intruder
+ * * `Invoiced` - Invoiced
+ * * `Invoiceninja` - Invoiceninja
+ * * `JamfPro` - JamfPro
+ * * `JobNimbus` - JobNimbus
+ * * `Jotform` - Jotform
+ * * `JudgeMeReviews` - JudgeMeReviews
+ * * `JustCall` - JustCall
+ * * `JustSift` - JustSift
+ * * `K6Cloud` - K6Cloud
+ * * `Katana` - Katana
+ * * `Keka` - Keka
+ * * `Kisi` - Kisi
+ * * `Kissmetrics` - Kissmetrics
+ * * `Klarna` - Klarna
+ * * `Klaus` - Klaus
+ * * `Lago` - Lago
+ * * `Leadfeeder` - Leadfeeder
+ * * `Lemlist` - Lemlist
+ * * `LessAnnoyingCRM` - LessAnnoyingCRM
+ * * `LinkedinPages` - LinkedinPages
+ * * `Linkrunner` - Linkrunner
+ * * `Linnworks` - Linnworks
+ * * `Lob` - Lob
+ * * `Lokalise` - Lokalise
+ * * `Looker` - Looker
+ * * `Luma` - Luma
+ * * `MailerSend` - MailerSend
+ * * `Mailosaur` - Mailosaur
+ * * `Mailtrap` - Mailtrap
+ * * `Mantle` - Mantle
+ * * `Mention` - Mention
+ * * `MercadoAds` - MercadoAds
+ * * `Merge` - Merge
+ * * `Metabase` - Metabase
+ * * `Metricool` - Metricool
+ * * `MicrosoftDataverse` - MicrosoftDataverse
+ * * `MicrosoftEntraId` - MicrosoftEntraId
+ * * `MicrosoftLists` - MicrosoftLists
+ * * `Miro` - Miro
+ * * `Missive` - Missive
+ * * `MixMax` - MixMax
+ * * `Mode` - Mode
+ * * `Mux` - Mux
+ * * `MyHours` - MyHours
+ * * `N8n` - N8n
+ * * `Navan` - Navan
+ * * `NebiusAI` - NebiusAI
+ * * `Nexiopay` - Nexiopay
+ * * `NinjaOneRMM` - NinjaOneRMM
+ * * `NoCRM` - NoCRM
+ * * `NorthpassLMS` - NorthpassLMS
+ * * `Nutshell` - Nutshell
+ * * `Nylas` - Nylas
+ * * `Oncehub` - Oncehub
+ * * `Onepagecrm` - Onepagecrm
+ * * `OneSignal` - OneSignal
+ * * `Onfleet` - Onfleet
+ * * `OpinionStage` - OpinionStage
+ * * `OPUSWatch` - OPUSWatch
+ * * `Orb` - Orb
+ * * `Orbit` - Orbit
+ * * `Oura` - Oura
+ * * `Oveit` - Oveit
+ * * `PabblySubscriptionsBilling` - PabblySubscriptionsBilling
+ * * `Paperform` - Paperform
+ * * `Papersign` - Papersign
+ * * `Partnerize` - Partnerize
+ * * `PartnerStack` - PartnerStack
+ * * `PayFit` - PayFit
+ * * `Paystack` - Paystack
+ * * `Pennylane` - Pennylane
+ * * `Perk` - Perk
+ * * `PersistIq` - PersistIq
+ * * `Persona` - Persona
+ * * `Phyllo` - Phyllo
+ * * `Picqer` - Picqer
+ * * `Pipeliner` - Pipeliner
+ * * `PivotalTracker` - PivotalTracker
+ * * `Piwik` - Piwik
+ * * `Planhat` - Planhat
+ * * `Plausible` - Plausible
+ * * `Poplar` - Poplar
+ * * `PrestaShop` - PrestaShop
+ * * `Pretix` - Pretix
+ * * `Primetric` - Primetric
+ * * `Printify` - Printify
+ * * `Productive` - Productive
+ * * `Pylon` - Pylon
+ * * `Qonto` - Qonto
+ * * `Qualaroo` - Qualaroo
+ * * `Railz` - Railz
+ * * `RDStationMarketing` - RDStationMarketing
+ * * `Recruitee` - Recruitee
+ * * `Reddit` - Reddit
+ * * `ReferralHero` - ReferralHero
+ * * `RentCast` - RentCast
+ * * `Repairshopr` - Repairshopr
+ * * `ReplyIo` - ReplyIo
+ * * `RetailExpress` - RetailExpress
+ * * `Retently` - Retently
+ * * `RevolutMerchant` - RevolutMerchant
+ * * `RocketChat` - RocketChat
+ * * `Rocketlane` - Rocketlane
+ * * `Rootly` - Rootly
+ * * `Ruddr` - Ruddr
+ * * `SafetyCulture` - SafetyCulture
+ * * `SageHR` - SageHR
+ * * `Salesflare` - Salesflare
+ * * `SAPFieldglass` - SAPFieldglass
+ * * `SavvyCal` - SavvyCal
+ * * `Secoda` - Secoda
+ * * `Segment` - Segment
+ * * `Sendowl` - Sendowl
+ * * `SendPulse` - SendPulse
+ * * `Senseforce` - Senseforce
+ * * `Serpstat` - Serpstat
+ * * `Sharetribe` - Sharetribe
+ * * `Shippo` - Shippo
+ * * `ShopWired` - ShopWired
+ * * `Shortio` - Shortio
+ * * `Shutterstock` - Shutterstock
+ * * `SigmaComputing` - SigmaComputing
+ * * `SignNow` - SignNow
+ * * `SimpleCast` - SimpleCast
+ * * `Simplesat` - Simplesat
+ * * `Smaily` - Smaily
+ * * `SmartEngage` - SmartEngage
+ * * `Smartreach` - Smartreach
+ * * `Smartwaiver` - Smartwaiver
+ * * `SolarwindsServiceDesk` - SolarwindsServiceDesk
+ * * `SonarCloud` - SonarCloud
+ * * `SparkPost` - SparkPost
+ * * `SplitIo` - SplitIo
+ * * `SpotifyAds` - SpotifyAds
+ * * `SpotlerCRM` - SpotlerCRM
+ * * `Squarespace` - Squarespace
+ * * `Statsig` - Statsig
+ * * `Statuspage` - Statuspage
+ * * `Stigg` - Stigg
+ * * `Strava` - Strava
+ * * `SurveySparrow` - SurveySparrow
+ * * `Survicate` - Survicate
+ * * `Svix` - Svix
+ * * `Systeme` - Systeme
+ * * `Tavus` - Tavus
+ * * `Teamtailor` - Teamtailor
+ * * `Teamwork` - Teamwork
+ * * `Tempo` - Tempo
+ * * `Testrail` - Testrail
+ * * `Thinkific` - Thinkific
+ * * `ThinkificCourses` - ThinkificCourses
+ * * `ThriveLearning` - ThriveLearning
+ * * `Ticketmaster` - Ticketmaster
+ * * `TicketTailor` - TicketTailor
+ * * `TickTick` - TickTick
+ * * `Timely` - Timely
+ * * `Tinyemail` - Tinyemail
+ * * `Todoist` - Todoist
+ * * `Toggl` - Toggl
+ * * `TrackPMS` - TrackPMS
+ * * `Tremendous` - Tremendous
+ * * `TrustPilot` - TrustPilot
+ * * `Twitter` - Twitter
+ * * `TyntecSMS` - TyntecSMS
+ * * `Unleash` - Unleash
+ * * `UpPromote` - UpPromote
+ * * `Uptick` - Uptick
+ * * `Uservoice` - Uservoice
+ * * `Vantage` - Vantage
+ * * `Veeqo` - Veeqo
+ * * `Vercel` - Vercel
+ * * `VismaEconomic` - VismaEconomic
+ * * `VWO` - VWO
+ * * `Waiteraid` - Waiteraid
+ * * `Wasabi` - Wasabi
+ * * `WhenIWork` - WhenIWork
+ * * `Wordpress` - Wordpress
+ * * `Workable` - Workable
+ * * `Workflowmax` - Workflowmax
+ * * `Workramp` - Workramp
+ * * `Wufoo` - Wufoo
+ * * `Xsolla` - Xsolla
+ * * `YandexMetrica` - YandexMetrica
+ * * `Yotpo` - Yotpo
+ * * `Ynab` - Ynab
+ * * `Younium` - Younium
+ * * `YouSign` - YouSign
+ * * `YoutubeData` - YoutubeData
+ * * `ZapierSupportedStorage` - ZapierSupportedStorage
+ * * `ZapSign` - ZapSign
+ * * `ZendeskSell` - ZendeskSell
+ * * `ZendeskSunshine` - ZendeskSunshine
+ * * `Zenefits` - Zenefits
+ * * `Zenloop` - Zenloop
+ * * `ZohoAnalytics` - ZohoAnalytics
+ * * `ZohoBigin` - ZohoBigin
+ * * `ZohoBilling` - ZohoBilling
+ * * `ZohoBooks` - ZohoBooks
+ * * `ZohoCampaign` - ZohoCampaign
+ * * `ZohoDesk` - ZohoDesk
+ * * `ZohoExpense` - ZohoExpense
+ * * `ZohoInventory` - ZohoInventory
+ * * `ZohoInvoice` - ZohoInvoice
+ * * `ZonkaFeedback` - ZonkaFeedback
+ * * `AlphaVantage` - AlphaVantage
+ * * `Aviationstack` - Aviationstack
+ * * `Bitly` - Bitly
+ * * `Blogger` - Blogger
+ * * `Breezometer` - Breezometer
+ * * `CareQualityCommission` - CareQualityCommission
+ * * `Cimis` - Cimis
+ * * `CoinApi` - CoinApi
+ * * `CoinGecko` - CoinGecko
+ * * `CoinMarketCap` - CoinMarketCap
+ * * `DingConnect` - DingConnect
+ * * `Dockerhub` - Dockerhub
+ * * `ExchangeRatesApi` - ExchangeRatesApi
+ * * `FinancialModelling` - FinancialModelling
+ * * `Finnhub` - Finnhub
+ * * `Finnworlds` - Finnworlds
+ * * `Giphy` - Giphy
+ * * `Gmail` - Gmail
+ * * `GNews` - GNews
+ * * `GoogleCalendar` - GoogleCalendar
+ * * `GoogleClassroom` - GoogleClassroom
+ * * `GoogleDirectory` - GoogleDirectory
+ * * `GoogleForms` - GoogleForms
+ * * `GooglePageSpeedInsights` - GooglePageSpeedInsights
+ * * `GoogleTasks` - GoogleTasks
+ * * `GoogleWebfonts` - GoogleWebfonts
+ * * `GoogleWorkspaceAdminReports` - GoogleWorkspaceAdminReports
+ * * `HuggingFace` - HuggingFace
+ * * `IlluminaBasespace` - IlluminaBasespace
+ * * `Imagga` - Imagga
+ * * `Interzoid` - Interzoid
+ * * `IP2Whois` - IP2Whois
+ * * `KYVE` - KYVE
+ * * `Marketstack` - Marketstack
+ * * `Mendeley` - Mendeley
+ * * `Nasa` - Nasa
+ * * `NewYorkTimes` - NewYorkTimes
+ * * `NewsApi` - NewsApi
+ * * `NewsData` - NewsData
+ * * `OpenDataDc` - OpenDataDc
+ * * `OpenExchangeRates` - OpenExchangeRates
+ * * `OpenAQ` - OpenAQ
+ * * `OpenFDA` - OpenFDA
+ * * `OpenWeather` - OpenWeather
+ * * `Outlook` - Outlook
+ * * `Perigon` - Perigon
+ * * `Pexels` - Pexels
+ * * `Pocket` - Pocket
+ * * `Polygon` - Polygon
+ * * `PyPI` - PyPI
+ * * `Recreation` - Recreation
+ * * `RKICovid` - RKICovid
+ * * `Rss` - Rss
+ * * `SimFin` - SimFin
+ * * `StockData` - StockData
+ * * `Guardian` - Guardian
+ * * `TMDb` - TMDb
+ * * `TVMaze` - TVMaze
+ * * `TwelveData` - TwelveData
+ * * `Ubidots` - Ubidots
+ * * `USCensus` - USCensus
+ * * `Watchmode` - Watchmode
+ * * `WikipediaPageviews` - WikipediaPageviews
+ * * `YahooFinance` - YahooFinance
+ * * `Clarifai` - Clarifai
+ * * `Adapty` - Adapty
+ * * `Braintrust` - Braintrust
+ * * `StreamElements` - StreamElements
+ * * `Streamlabs` - Streamlabs
+ * * `Datorama` - Datorama
+ * * `Ahrefs` - Ahrefs
+ * * `Lightfield` - Lightfield
+ * * `Appstack` - Appstack
+ * * `Razorpay` - Razorpay
+ * * `Neon` - Neon
+ * * `NewRelic` - NewRelic
+ * * `Custom` - Custom
+ * * `Tile38` - Tile38
+ * * `Chatwoot` - Chatwoot
+ * * `Sanity` - Sanity
+ * * `Metronome` - Metronome
+ * * `Jobber` - Jobber
+ * * `Knock` - Knock
+ * * `Leexi` - Leexi
+ * * `RB2B` - RB2B
+ * * `Superwall` - Superwall */
+ source_type: ExternalDataSourceTypeEnumApi
+ /** Source config as flat keys. For source_type 'Custom': 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the manifest's declared auth type — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic). Secrets stay in these auth_* keys, never inline in the manifest. */
+ payload?: SourcePreviewRequestApiPayload
+ /** Which manifest resource (table) to read a sample from — one of the resource names in manifest_json. */
+ resource_name: string
+ /**
+ * Maximum sample rows to return (1–50). Defaults to 10.
+ * @minimum 1
+ * @maximum 50
+ */
+ limit?: number
+}
+
+export type SourcePreviewResponseApiRowsItem = { [key: string]: unknown }
+
+export interface SourcePreviewColumnApi {
+ /** Column name as it appears in the previewed rows. */
+ name: string
+ /** JSON type inferred from the first non-null value: string, integer, number, boolean, object, array, or null. */
+ type: string
+}
+
+export interface SourcePreviewResponseApi {
+ /** Up to `limit` sample rows, after data_selector extraction — the raw records the sync would ingest. */
+ rows: SourcePreviewResponseApiRowsItem[]
+ /** Number of sample rows returned (≤ limit). */
+ row_count: number
+ /** Columns observed across the sample rows, each with an inferred JSON type. */
+ columns: SourcePreviewColumnApi[]
+ /**
+ * Set when the live read failed (e.g. the host was unreachable or returned an auth error); rows is then empty. Manifest, validation, and SSRF problems return HTTP 400 instead of populating this field.
+ * @nullable
+ */
+ error: string | null
+}
+
/**
* Connection details as flat keys for the source_type (discover required fields with the wizard tool). Prefer references over raw secrets: pass {'credential_id': <id>} referencing the connection details the user stored via the connect-link page (discover ids with the stored_credentials endpoint) — they are merged in server-side and deleted once consumed. An already-connected OAuth integration can be passed via its id key instead (e.g. {'hubspot_integration_id': 123}). For source_type 'Custom' (a user-defined REST API) the keys are 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the auth type the manifest declares — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic); keep secrets in these auth_* keys, never inline in the manifest. A 'schemas' array is NOT required — all discovered tables are enabled automatically with sensible sync defaults.
*/
diff --git a/products/warehouse_sources/frontend/generated/api.ts b/products/warehouse_sources/frontend/generated/api.ts
index 7b04f32c4dc6..ee9ec1425ec0 100644
--- a/products/warehouse_sources/frontend/generated/api.ts
+++ b/products/warehouse_sources/frontend/generated/api.ts
@@ -30,6 +30,8 @@ import type {
SourceConnectLinkApi,
SourceCredentialApi,
SourceCredentialCreateApi,
+ SourcePreviewRequestApi,
+ SourcePreviewResponseApi,
SourceSetupApi,
SourceSetupResponseApi,
} from './api.schemas'
@@ -867,6 +869,32 @@ export const externalDataSourcesDatabaseSchemaCreate = async (
})
}
+export const getExternalDataSourcesPreviewResourceCreateUrl = (projectId: string) => {
+ return `/api/projects/${projectId}/external_data_sources/preview_resource/`
+}
+
+/**
+ * Read a bounded sample of rows for one resource of a Custom REST source.
+ *
+ * Lets a manifest author verify `data_selector`, `primary_key`, and the incremental
+ * `cursor_path` against live data before creating the source. Only `source_type: "Custom"`
+ * is supported — other source types return 400. The read is bounded (single page per
+ * resource, capped row count, short timeouts, no redirects). Manifest, validation, and SSRF
+ * problems return 400; a live fetch failure returns 200 with `error` set and empty `rows`.
+ */
+export const externalDataSourcesPreviewResourceCreate = async (
+ projectId: string,
+ sourcePreviewRequestApi: SourcePreviewRequestApi,
+ options?: RequestInit
+): Promise<SourcePreviewResponseApi> => {
+ return apiMutator<SourcePreviewResponseApi>(getExternalDataSourcesPreviewResourceCreateUrl(projectId), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(sourcePreviewRequestApi),
+ })
+}
+
export const getExternalDataSourcesSetupCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/external_data_sources/setup/`
}
diff --git a/products/warehouse_sources/frontend/generated/api.zod.ts b/products/warehouse_sources/frontend/generated/api.zod.ts
index fd113e5df2f6..8e2d2f146499 100644
--- a/products/warehouse_sources/frontend/generated/api.zod.ts
+++ b/products/warehouse_sources/frontend/generated/api.zod.ts
@@ -2558,6 +2558,687 @@ export const ExternalDataSourcesDatabaseSchemaCreateBody = /* @__PURE__ */ zod
'Validate credentials and preview available tables from a remote database.\n\nThe request body contains source_type plus flat source-specific credential fields\n(e.g. host, port, database, user, password, schema for Postgres). The credential\nfields vary per source_type and are validated dynamically by the source registry.\n\nFor source_type \"Custom\" (a user-defined REST API) the body carries `manifest_json`\n(a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the\ncredential for the manifest\'s declared auth type — `auth_token` (bearer), `auth_api_key`\n(api_key), or `auth_password` (http_basic); keep secrets in these auth_\* keys, never\ninline in manifest_json. The returned tables mirror the manifest\'s resources, with\ndetected primary keys and incremental cursors.'
)
+/**
+ * Read a bounded sample of rows for one resource of a Custom REST source.
+ *
+ * Lets a manifest author verify `data_selector`, `primary_key`, and the incremental
+ * `cursor_path` against live data before creating the source. Only `source_type: "Custom"`
+ * is supported — other source types return 400. The read is bounded (single page per
+ * resource, capped row count, short timeouts, no redirects). Manifest, validation, and SSRF
+ * problems return 400; a live fetch failure returns 200 with `error` set and empty `rows`.
+ */
+export const externalDataSourcesPreviewResourceCreateBodyLimitDefault = 10
+export const externalDataSourcesPreviewResourceCreateBodyLimitMax = 50
+
+export const ExternalDataSourcesPreviewResourceCreateBody = /* @__PURE__ */ zod.object({
+ source_type: zod
+ .enum([
+ 'Ashby',
+ 'Supabase',
+ 'CustomerIO',
+ 'Github',
+ 'Stripe',
+ 'Hubspot',
+ 'Postgres',
+ 'Zendesk',
+ 'Snowflake',
+ 'Salesforce',
+ 'MySQL',
+ 'MongoDB',
+ 'MSSQL',
+ 'Vitally',
+ 'BigQuery',
+ 'Chargebee',
+ 'Clerk',
+ 'GoogleAds',
+ 'GoogleSearchConsole',
+ 'TemporalIO',
+ 'DoIt',
+ 'GoogleSheets',
+ 'MetaAds',
+ 'Klaviyo',
+ 'Mailchimp',
+ 'Braze',
+ 'Mailjet',
+ 'Redshift',
+ 'Polar',
+ 'RevenueCat',
+ 'LinkedinAds',
+ 'RedditAds',
+ 'TikTokAds',
+ 'BingAds',
+ 'Shopify',
+ 'Attio',
+ 'SnapchatAds',
+ 'Linear',
+ 'Intercom',
+ 'Amplitude',
+ 'Mixpanel',
+ 'Jira',
+ 'ActiveCampaign',
+ 'Marketo',
+ 'Adjust',
+ 'AppsFlyer',
+ 'Freshdesk',
+ 'GoogleAnalytics',
+ 'Pipedrive',
+ 'SendGrid',
+ 'Slack',
+ 'PagerDuty',
+ 'Asana',
+ 'Notion',
+ 'Airtable',
+ 'Greenhouse',
+ 'BambooHR',
+ 'Lever',
+ 'GitLab',
+ 'Datadog',
+ 'Sentry',
+ 'Pendo',
+ 'FullStory',
+ 'AmazonAds',
+ 'PinterestAds',
+ 'AppleSearchAds',
+ 'QuickBooks',
+ 'Xero',
+ 'NetSuite',
+ 'WooCommerce',
+ 'BigCommerce',
+ 'PayPal',
+ 'Square',
+ 'Zoom',
+ 'Trello',
+ 'Monday',
+ 'ClickUp',
+ 'Confluence',
+ 'Recurly',
+ 'SalesLoft',
+ 'Outreach',
+ 'Gong',
+ 'Calendly',
+ 'Typeform',
+ 'Iterable',
+ 'ZohoCRM',
+ 'Close',
+ 'Oracle',
+ 'DynamoDB',
+ 'Elasticsearch',
+ 'Kafka',
+ 'LaunchDarkly',
+ 'Braintree',
+ 'Recharge',
+ 'HelpScout',
+ 'Gorgias',
+ 'Instagram',
+ 'YouTubeAnalytics',
+ 'FacebookPages',
+ 'TwitterAds',
+ 'Workday',
+ 'ServiceNow',
+ 'Pardot',
+ 'Copper',
+ 'Front',
+ 'ChartMogul',
+ 'Zuora',
+ 'Paddle',
+ 'CircleCI',
+ 'CockroachDB',
+ 'Firebase',
+ 'AzureBlob',
+ 'GoogleDrive',
+ 'OneDrive',
+ 'SharePoint',
+ 'Box',
+ 'SFTP',
+ 'MicrosoftTeams',
+ 'Aircall',
+ 'Webflow',
+ 'Okta',
+ 'Auth0',
+ 'Productboard',
+ 'Smartsheet',
+ 'Wrike',
+ 'Plaid',
+ 'SurveyMonkey',
+ 'Eventbrite',
+ 'RingCentral',
+ 'Twilio',
+ 'Freshsales',
+ 'Shortcut',
+ 'ConvertKit',
+ 'Drip',
+ 'CampaignMonitor',
+ 'MailerLite',
+ 'Omnisend',
+ 'Brevo',
+ 'Postmark',
+ 'Granola',
+ 'BuildBetter',
+ 'Convex',
+ 'ClickHouse',
+ 'Plain',
+ 'Resend',
+ 'PgAnalyze',
+ 'WorkOS',
+ 'AmazonS3',
+ 'GoogleCloudStorage',
+ 'Databricks',
+ 'Dynamics365',
+ 'SalesforceMarketingCloud',
+ 'Db2',
+ 'Heap',
+ 'AdobeAnalytics',
+ 'Matomo',
+ 'Optimizely',
+ 'Adyen',
+ 'GoCardless',
+ 'Mollie',
+ 'CheckoutCom',
+ 'Branch',
+ 'Criteo',
+ 'Outbrain',
+ 'Taboola',
+ 'AdRoll',
+ 'DisplayVideo360',
+ 'GoogleAdManager',
+ 'CampaignManager360',
+ 'SearchAds360',
+ 'AdobeCommerce',
+ 'AmazonSellingPartner',
+ 'Ebay',
+ 'Commercetools',
+ 'LightspeedRetail',
+ 'ShipStation',
+ 'ConstantContact',
+ 'Mailgun',
+ 'Eloqua',
+ 'Sailthru',
+ 'Ortto',
+ 'Attentive',
+ 'Kustomer',
+ 'Dixa',
+ 'Gladly',
+ 'Qualtrics',
+ 'Delighted',
+ 'AzureDevOps',
+ 'Rollbar',
+ 'Opsgenie',
+ 'IncidentIo',
+ 'Pingdom',
+ 'Cloudflare',
+ 'CosmosDB',
+ 'PlanetScale',
+ 'SapHana',
+ 'Rippling',
+ 'HiBob',
+ 'Personio',
+ 'Deel',
+ 'AdpWorkforceNow',
+ 'Paylocity',
+ 'Gusto',
+ 'CultureAmp',
+ 'Lattice',
+ 'SageIntacct',
+ 'FreshBooks',
+ 'Expensify',
+ 'Ramp',
+ 'Brex',
+ 'Coupa',
+ 'SapConcur',
+ 'Apollo',
+ 'Crunchbase',
+ 'ZoomInfo',
+ 'Clari',
+ 'Chorus',
+ 'Coda',
+ 'Guru',
+ 'Dropbox',
+ 'Docusign',
+ 'PandaDoc',
+ 'SapErp',
+ 'SapSuccessFactors',
+ 'OracleEbs',
+ 'OracleFusion',
+ 'AmazonSNS',
+ 'AmazonEventBridge',
+ 'AmazonSQS',
+ 'AmazonKinesis',
+ 'AmazonCloudWatch',
+ 'OpenAIAds',
+ 'OneHundredMs',
+ 'SevenShifts',
+ 'AcuityScheduling',
+ 'AgileCRM',
+ 'Aha',
+ 'Airbyte',
+ 'Akeneo',
+ 'Algolia',
+ 'AlpacaBrokerAPI',
+ 'ApifyDataset',
+ 'Appcues',
+ 'Appfigures',
+ 'Appfollow',
+ 'Apptivo',
+ 'AssemblyAI',
+ 'Awin',
+ 'AwsCloudTrail',
+ 'AzureTableStorage',
+ 'Babelforce',
+ 'Basecamp',
+ 'Beamer',
+ 'BigMailer',
+ 'Bluetally',
+ 'BoldSign',
+ 'BreezyHR',
+ 'Bugsnag',
+ 'Buildkite',
+ 'Bunny',
+ 'Buzzsprout',
+ 'CalCom',
+ 'CallRail',
+ 'Campayn',
+ 'Canny',
+ 'CapsuleCRM',
+ 'CaptainData',
+ 'CartCom',
+ 'CastorEDC',
+ 'Chameleon',
+ 'Chargedesk',
+ 'Chargify',
+ 'Chift',
+ 'Churnkey',
+ 'Cin7',
+ 'CiscoMeraki',
+ 'Clazar',
+ 'Clockify',
+ 'Clockodo',
+ 'Cloudbeds',
+ 'Coassemble',
+ 'Codefresh',
+ 'Concord',
+ 'ConfigCat',
+ 'Couchbase',
+ 'Curve',
+ 'Customerly',
+ 'Datascope',
+ 'Dbt',
+ 'Deputy',
+ 'DevinAI',
+ 'Docuseal',
+ 'Dolibarr',
+ 'Dremio',
+ 'DropboxSign',
+ 'Dwolla',
+ 'EConomic',
+ 'Easypost',
+ 'Easypromos',
+ 'Elasticemail',
+ 'EmailOctopus',
+ 'EmploymentHero',
+ 'Encharge',
+ 'Eventee',
+ 'Eventzilla',
+ 'Everhour',
+ 'EZOfficeInventory',
+ 'Factorial',
+ 'Fastbill',
+ 'Fastly',
+ 'Fauna',
+ 'Feishu',
+ 'Fillout',
+ 'Finage',
+ 'Firebolt',
+ 'FireHydrant',
+ 'Fleetio',
+ 'Flexmail',
+ 'Flexport',
+ 'FloatApp',
+ 'Flowlu',
+ 'Formbricks',
+ 'FreeAgent',
+ 'Freightview',
+ 'Freshcaller',
+ 'Freshchat',
+ 'Freshservice',
+ 'Fulcrum',
+ 'GainsightPx',
+ 'GitBook',
+ 'Glassfrog',
+ 'Goldcast',
+ 'GoLogin',
+ 'Grafana',
+ 'GreytHr',
+ 'Gridly',
+ 'Harness',
+ 'Height',
+ 'Hellobaton',
+ 'HighLevel',
+ 'HoorayHR',
+ 'Hubplanner',
+ 'Humanitix',
+ 'Huntr',
+ 'Inflowinventory',
+ 'InforNexus',
+ 'Insightful',
+ 'Insightly',
+ 'Instatus',
+ 'Intruder',
+ 'Invoiced',
+ 'Invoiceninja',
+ 'JamfPro',
+ 'JobNimbus',
+ 'Jotform',
+ 'JudgeMeReviews',
+ 'JustCall',
+ 'JustSift',
+ 'K6Cloud',
+ 'Katana',
+ 'Keka',
+ 'Kisi',
+ 'Kissmetrics',
+ 'Klarna',
+ 'Klaus',
+ 'Lago',
+ 'Leadfeeder',
+ 'Lemlist',
+ 'LessAnnoyingCRM',
+ 'LinkedinPages',
+ 'Linkrunner',
+ 'Linnworks',
+ 'Lob',
+ 'Lokalise',
+ 'Looker',
+ 'Luma',
+ 'MailerSend',
+ 'Mailosaur',
+ 'Mailtrap',
+ 'Mantle',
+ 'Mention',
+ 'MercadoAds',
+ 'Merge',
+ 'Metabase',
+ 'Metricool',
+ 'MicrosoftDataverse',
+ 'MicrosoftEntraId',
+ 'MicrosoftLists',
+ 'Miro',
+ 'Missive',
+ 'MixMax',
+ 'Mode',
+ 'Mux',
+ 'MyHours',
+ 'N8n',
+ 'Navan',
+ 'NebiusAI',
+ 'Nexiopay',
+ 'NinjaOneRMM',
+ 'NoCRM',
+ 'NorthpassLMS',
+ 'Nutshell',
+ 'Nylas',
+ 'Oncehub',
+ 'Onepagecrm',
+ 'OneSignal',
+ 'Onfleet',
+ 'OpinionStage',
+ 'OPUSWatch',
+ 'Orb',
+ 'Orbit',
+ 'Oura',
+ 'Oveit',
+ 'PabblySubscriptionsBilling',
+ 'Paperform',
+ 'Papersign',
+ 'Partnerize',
+ 'PartnerStack',
+ 'PayFit',
+ 'Paystack',
+ 'Pennylane',
+ 'Perk',
+ 'PersistIq',
+ 'Persona',
+ 'Phyllo',
+ 'Picqer',
+ 'Pipeliner',
+ 'PivotalTracker',
+ 'Piwik',
+ 'Planhat',
+ 'Plausible',
+ 'Poplar',
+ 'PrestaShop',
+ 'Pretix',
+ 'Primetric',
+ 'Printify',
+ 'Productive',
+ 'Pylon',
+ 'Qonto',
+ 'Qualaroo',
+ 'Railz',
+ 'RDStationMarketing',
+ 'Recruitee',
+ 'Reddit',
+ 'ReferralHero',
+ 'RentCast',
+ 'Repairshopr',
+ 'ReplyIo',
+ 'RetailExpress',
+ 'Retently',
+ 'RevolutMerchant',
+ 'RocketChat',
+ 'Rocketlane',
+ 'Rootly',
+ 'Ruddr',
+ 'SafetyCulture',
+ 'SageHR',
+ 'Salesflare',
+ 'SAPFieldglass',
+ 'SavvyCal',
+ 'Secoda',
+ 'Segment',
+ 'Sendowl',
+ 'SendPulse',
+ 'Senseforce',
+ 'Serpstat',
+ 'Sharetribe',
+ 'Shippo',
+ 'ShopWired',
+ 'Shortio',
+ 'Shutterstock',
+ 'SigmaComputing',
+ 'SignNow',
+ 'SimpleCast',
+ 'Simplesat',
+ 'Smaily',
+ 'SmartEngage',
+ 'Smartreach',
+ 'Smartwaiver',
+ 'SolarwindsServiceDesk',
+ 'SonarCloud',
+ 'SparkPost',
+ 'SplitIo',
+ 'SpotifyAds',
+ 'SpotlerCRM',
+ 'Squarespace',
+ 'Statsig',
+ 'Statuspage',
+ 'Stigg',
+ 'Strava',
+ 'SurveySparrow',
+ 'Survicate',
+ 'Svix',
+ 'Systeme',
+ 'Tavus',
+ 'Teamtailor',
+ 'Teamwork',
+ 'Tempo',
+ 'Testrail',
+ 'Thinkific',
+ 'ThinkificCourses',
+ 'ThriveLearning',
+ 'Ticketmaster',
+ 'TicketTailor',
+ 'TickTick',
+ 'Timely',
+ 'Tinyemail',
+ 'Todoist',
+ 'Toggl',
+ 'TrackPMS',
+ 'Tremendous',
+ 'TrustPilot',
+ 'Twitter',
+ 'TyntecSMS',
+ 'Unleash',
+ 'UpPromote',
+ 'Uptick',
+ 'Uservoice',
+ 'Vantage',
+ 'Veeqo',
+ 'Vercel',
+ 'VismaEconomic',
+ 'VWO',
+ 'Waiteraid',
+ 'Wasabi',
+ 'WhenIWork',
+ 'Wordpress',
+ 'Workable',
+ 'Workflowmax',
+ 'Workramp',
+ 'Wufoo',
+ 'Xsolla',
+ 'YandexMetrica',
+ 'Yotpo',
+ 'Ynab',
+ 'Younium',
+ 'YouSign',
+ 'YoutubeData',
+ 'ZapierSupportedStorage',
+ 'ZapSign',
+ 'ZendeskSell',
+ 'ZendeskSunshine',
+ 'Zenefits',
+ 'Zenloop',
+ 'ZohoAnalytics',
+ 'ZohoBigin',
+ 'ZohoBilling',
+ 'ZohoBooks',
+ 'ZohoCampaign',
+ 'ZohoDesk',
+ 'ZohoExpense',
+ 'ZohoInventory',
+ 'ZohoInvoice',
+ 'ZonkaFeedback',
+ 'AlphaVantage',
+ 'Aviationstack',
+ 'Bitly',
+ 'Blogger',
+ 'Breezometer',
+ 'CareQualityCommission',
+ 'Cimis',
+ 'CoinApi',
+ 'CoinGecko',
+ 'CoinMarketCap',
+ 'DingConnect',
+ 'Dockerhub',
+ 'ExchangeRatesApi',
+ 'FinancialModelling',
+ 'Finnhub',
+ 'Finnworlds',
+ 'Giphy',
+ 'Gmail',
+ 'GNews',
+ 'GoogleCalendar',
+ 'GoogleClassroom',
+ 'GoogleDirectory',
+ 'GoogleForms',
+ 'GooglePageSpeedInsights',
+ 'GoogleTasks',
+ 'GoogleWebfonts',
+ 'GoogleWorkspaceAdminReports',
+ 'HuggingFace',
+ 'IlluminaBasespace',
+ 'Imagga',
+ 'Interzoid',
+ 'IP2Whois',
+ 'KYVE',
+ 'Marketstack',
+ 'Mendeley',
+ 'Nasa',
+ 'NewYorkTimes',
+ 'NewsApi',
+ 'NewsData',
+ 'OpenDataDc',
+ 'OpenExchangeRates',
+ 'OpenAQ',
+ 'OpenFDA',
+ 'OpenWeather',
+ 'Outlook',
+ 'Perigon',
+ 'Pexels',
+ 'Pocket',
+ 'Polygon',
+ 'PyPI',
+ 'Recreation',
+ 'RKICovid',
+ 'Rss',
+ 'SimFin',
+ 'StockData',
+ 'Guardian',
+ 'TMDb',
+ 'TVMaze',
+ 'TwelveData',
+ 'Ubidots',
+ 'USCensus',
+ 'Watchmode',
+ 'WikipediaPageviews',
+ 'YahooFinance',
+ 'Clarifai',
+ 'Adapty',
+ 'Braintrust',
+ 'StreamElements',
+ 'Streamlabs',
+ 'Datorama',
+ 'Ahrefs',
+ 'Lightfield',
+ 'Appstack',
+ 'Razorpay',
+ 'Neon',
+ 'NewRelic',
+ 'Custom',
+ 'Tile38',
+ 'Chatwoot',
+ 'Sanity',
+ 'Metronome',
+ 'Jobber',
+ 'Knock',
+ 'Leexi',
+ 'RB2B',
+ 'Superwall',
+ ])
+ .describe(
+ '\* `Ashby` - Ashby\n\* `Supabase` - Supabase\n\* `CustomerIO` - CustomerIO\n\* `Github` - Github\n\* `Stripe` - Stripe\n\* `Hubspot` - Hubspot\n\* `Postgres` - Postgres\n\* `Zendesk` - Zendesk\n\* `Snowflake` - Snowflake\n\* `Salesforce` - Salesforce\n\* `MySQL` - MySQL\n\* `MongoDB` - MongoDB\n\* `MSSQL` - MSSQL\n\* `Vitally` - Vitally\n\* `BigQuery` - BigQuery\n\* `Chargebee` - Chargebee\n\* `Clerk` - Clerk\n\* `GoogleAds` - GoogleAds\n\* `GoogleSearchConsole` - GoogleSearchConsole\n\* `TemporalIO` - TemporalIO\n\* `DoIt` - DoIt\n\* `GoogleSheets` - GoogleSheets\n\* `MetaAds` - MetaAds\n\* `Klaviyo` - Klaviyo\n\* `Mailchimp` - Mailchimp\n\* `Braze` - Braze\n\* `Mailjet` - Mailjet\n\* `Redshift` - Redshift\n\* `Polar` - Polar\n\* `RevenueCat` - RevenueCat\n\* `LinkedinAds` - LinkedinAds\n\* `RedditAds` - RedditAds\n\* `TikTokAds` - TikTokAds\n\* `BingAds` - BingAds\n\* `Shopify` - Shopify\n\* `Attio` - Attio\n\* `SnapchatAds` - SnapchatAds\n\* `Linear` - Linear\n\* `Intercom` - Intercom\n\* `Amplitude` - Amplitude\n\* `Mixpanel` - Mixpanel\n\* `Jira` - Jira\n\* `ActiveCampaign` - ActiveCampaign\n\* `Marketo` - Marketo\n\* `Adjust` - Adjust\n\* `AppsFlyer` - AppsFlyer\n\* `Freshdesk` - Freshdesk\n\* `GoogleAnalytics` - GoogleAnalytics\n\* `Pipedrive` - Pipedrive\n\* `SendGrid` - SendGrid\n\* `Slack` - Slack\n\* `PagerDuty` - PagerDuty\n\* `Asana` - Asana\n\* `Notion` - Notion\n\* `Airtable` - Airtable\n\* `Greenhouse` - Greenhouse\n\* `BambooHR` - BambooHR\n\* `Lever` - Lever\n\* `GitLab` - GitLab\n\* `Datadog` - Datadog\n\* `Sentry` - Sentry\n\* `Pendo` - Pendo\n\* `FullStory` - FullStory\n\* `AmazonAds` - AmazonAds\n\* `PinterestAds` - PinterestAds\n\* `AppleSearchAds` - AppleSearchAds\n\* `QuickBooks` - QuickBooks\n\* `Xero` - Xero\n\* `NetSuite` - NetSuite\n\* `WooCommerce` - WooCommerce\n\* `BigCommerce` - BigCommerce\n\* `PayPal` - PayPal\n\* `Square` - Square\n\* `Zoom` - Zoom\n\* `Trello` - Trello\n\* `Monday` - Monday\n\* `ClickUp` - ClickUp\n\* `Confluence` - Confluence\n\* `Recurly` - Recurly\n\* `SalesLoft` - SalesLoft\n\* `Outreach` - Outreach\n\* `Gong` - Gong\n\* `Calendly` - Calendly\n\* `Typeform` - Typeform\n\* `Iterable` - Iterable\n\* `ZohoCRM` - ZohoCRM\n\* `Close` - Close\n\* `Oracle` - Oracle\n\* `DynamoDB` - DynamoDB\n\* `Elasticsearch` - Elasticsearch\n\* `Kafka` - Kafka\n\* `LaunchDarkly` - LaunchDarkly\n\* `Braintree` - Braintree\n\* `Recharge` - Recharge\n\* `HelpScout` - HelpScout\n\* `Gorgias` - Gorgias\n\* `Instagram` - Instagram\n\* `YouTubeAnalytics` - YouTubeAnalytics\n\* `FacebookPages` - FacebookPages\n\* `TwitterAds` - TwitterAds\n\* `Workday` - Workday\n\* `ServiceNow` - ServiceNow\n\* `Pardot` - Pardot\n\* `Copper` - Copper\n\* `Front` - Front\n\* `ChartMogul` - ChartMogul\n\* `Zuora` - Zuora\n\* `Paddle` - Paddle\n\* `CircleCI` - CircleCI\n\* `CockroachDB` - CockroachDB\n\* `Firebase` - Firebase\n\* `AzureBlob` - AzureBlob\n\* `GoogleDrive` - GoogleDrive\n\* `OneDrive` - OneDrive\n\* `SharePoint` - SharePoint\n\* `Box` - Box\n\* `SFTP` - SFTP\n\* `MicrosoftTeams` - MicrosoftTeams\n\* `Aircall` - Aircall\n\* `Webflow` - Webflow\n\* `Okta` - Okta\n\* `Auth0` - Auth0\n\* `Productboard` - Productboard\n\* `Smartsheet` - Smartsheet\n\* `Wrike` - Wrike\n\* `Plaid` - Plaid\n\* `SurveyMonkey` - SurveyMonkey\n\* `Eventbrite` - Eventbrite\n\* `RingCentral` - RingCentral\n\* `Twilio` - Twilio\n\* `Freshsales` - Freshsales\n\* `Shortcut` - Shortcut\n\* `ConvertKit` - ConvertKit\n\* `Drip` - Drip\n\* `CampaignMonitor` - CampaignMonitor\n\* `MailerLite` - MailerLite\n\* `Omnisend` - Omnisend\n\* `Brevo` - Brevo\n\* `Postmark` - Postmark\n\* `Granola` - Granola\n\* `BuildBetter` - BuildBetter\n\* `Convex` - Convex\n\* `ClickHouse` - ClickHouse\n\* `Plain` - Plain\n\* `Resend` - Resend\n\* `PgAnalyze` - PgAnalyze\n\* `WorkOS` - WorkOS\n\* `AmazonS3` - AmazonS3\n\* `GoogleCloudStorage` - GoogleCloudStorage\n\* `Databricks` - Databricks\n\* `Dynamics365` - Dynamics365\n\* `SalesforceMarketingCloud` - SalesforceMarketingCloud\n\* `Db2` - Db2\n\* `Heap` - Heap\n\* `AdobeAnalytics` - AdobeAnalytics\n\* `Matomo` - Matomo\n\* `Optimizely` - Optimizely\n\* `Adyen` - Adyen\n\* `GoCardless` - GoCardless\n\* `Mollie` - Mollie\n\* `CheckoutCom` - CheckoutCom\n\* `Branch` - Branch\n\* `Criteo` - Criteo\n\* `Outbrain` - Outbrain\n\* `Taboola` - Taboola\n\* `AdRoll` - AdRoll\n\* `DisplayVideo360` - DisplayVideo360\n\* `GoogleAdManager` - GoogleAdManager\n\* `CampaignManager360` - CampaignManager360\n\* `SearchAds360` - SearchAds360\n\* `AdobeCommerce` - AdobeCommerce\n\* `AmazonSellingPartner` - AmazonSellingPartner\n\* `Ebay` - Ebay\n\* `Commercetools` - Commercetools\n\* `LightspeedRetail` - LightspeedRetail\n\* `ShipStation` - ShipStation\n\* `ConstantContact` - ConstantContact\n\* `Mailgun` - Mailgun\n\* `Eloqua` - Eloqua\n\* `Sailthru` - Sailthru\n\* `Ortto` - Ortto\n\* `Attentive` - Attentive\n\* `Kustomer` - Kustomer\n\* `Dixa` - Dixa\n\* `Gladly` - Gladly\n\* `Qualtrics` - Qualtrics\n\* `Delighted` - Delighted\n\* `AzureDevOps` - AzureDevOps\n\* `Rollbar` - Rollbar\n\* `Opsgenie` - Opsgenie\n\* `IncidentIo` - IncidentIo\n\* `Pingdom` - Pingdom\n\* `Cloudflare` - Cloudflare\n\* `CosmosDB` - CosmosDB\n\* `PlanetScale` - PlanetScale\n\* `SapHana` - SapHana\n\* `Rippling` - Rippling\n\* `HiBob` - HiBob\n\* `Personio` - Personio\n\* `Deel` - Deel\n\* `AdpWorkforceNow` - AdpWorkforceNow\n\* `Paylocity` - Paylocity\n\* `Gusto` - Gusto\n\* `CultureAmp` - CultureAmp\n\* `Lattice` - Lattice\n\* `SageIntacct` - SageIntacct\n\* `FreshBooks` - FreshBooks\n\* `Expensify` - Expensify\n\* `Ramp` - Ramp\n\* `Brex` - Brex\n\* `Coupa` - Coupa\n\* `SapConcur` - SapConcur\n\* `Apollo` - Apollo\n\* `Crunchbase` - Crunchbase\n\* `ZoomInfo` - ZoomInfo\n\* `Clari` - Clari\n\* `Chorus` - Chorus\n\* `Coda` - Coda\n\* `Guru` - Guru\n\* `Dropbox` - Dropbox\n\* `Docusign` - Docusign\n\* `PandaDoc` - PandaDoc\n\* `SapErp` - SapErp\n\* `SapSuccessFactors` - SapSuccessFactors\n\* `OracleEbs` - OracleEbs\n\* `OracleFusion` - OracleFusion\n\* `AmazonSNS` - AmazonSNS\n\* `AmazonEventBridge` - AmazonEventBridge\n\* `AmazonSQS` - AmazonSQS\n\* `AmazonKinesis` - AmazonKinesis\n\* `AmazonCloudWatch` - AmazonCloudWatch\n\* `OpenAIAds` - OpenAIAds\n\* `OneHundredMs` - OneHundredMs\n\* `SevenShifts` - SevenShifts\n\* `AcuityScheduling` - AcuityScheduling\n\* `AgileCRM` - AgileCRM\n\* `Aha` - Aha\n\* `Airbyte` - Airbyte\n\* `Akeneo` - Akeneo\n\* `Algolia` - Algolia\n\* `AlpacaBrokerAPI` - AlpacaBrokerAPI\n\* `ApifyDataset` - ApifyDataset\n\* `Appcues` - Appcues\n\* `Appfigures` - Appfigures\n\* `Appfollow` - Appfollow\n\* `Apptivo` - Apptivo\n\* `AssemblyAI` - AssemblyAI\n\* `Awin` - Awin\n\* `AwsCloudTrail` - AwsCloudTrail\n\* `AzureTableStorage` - AzureTableStorage\n\* `Babelforce` - Babelforce\n\* `Basecamp` - Basecamp\n\* `Beamer` - Beamer\n\* `BigMailer` - BigMailer\n\* `Bluetally` - Bluetally\n\* `BoldSign` - BoldSign\n\* `BreezyHR` - BreezyHR\n\* `Bugsnag` - Bugsnag\n\* `Buildkite` - Buildkite\n\* `Bunny` - Bunny\n\* `Buzzsprout` - Buzzsprout\n\* `CalCom` - CalCom\n\* `CallRail` - CallRail\n\* `Campayn` - Campayn\n\* `Canny` - Canny\n\* `CapsuleCRM` - CapsuleCRM\n\* `CaptainData` - CaptainData\n\* `CartCom` - CartCom\n\* `CastorEDC` - CastorEDC\n\* `Chameleon` - Chameleon\n\* `Chargedesk` - Chargedesk\n\* `Chargify` - Chargify\n\* `Chift` - Chift\n\* `Churnkey` - Churnkey\n\* `Cin7` - Cin7\n\* `CiscoMeraki` - CiscoMeraki\n\* `Clazar` - Clazar\n\* `Clockify` - Clockify\n\* `Clockodo` - Clockodo\n\* `Cloudbeds` - Cloudbeds\n\* `Coassemble` - Coassemble\n\* `Codefresh` - Codefresh\n\* `Concord` - Concord\n\* `ConfigCat` - ConfigCat\n\* `Couchbase` - Couchbase\n\* `Curve` - Curve\n\* `Customerly` - Customerly\n\* `Datascope` - Datascope\n\* `Dbt` - Dbt\n\* `Deputy` - Deputy\n\* `DevinAI` - DevinAI\n\* `Docuseal` - Docuseal\n\* `Dolibarr` - Dolibarr\n\* `Dremio` - Dremio\n\* `DropboxSign` - DropboxSign\n\* `Dwolla` - Dwolla\n\* `EConomic` - EConomic\n\* `Easypost` - Easypost\n\* `Easypromos` - Easypromos\n\* `Elasticemail` - Elasticemail\n\* `EmailOctopus` - EmailOctopus\n\* `EmploymentHero` - EmploymentHero\n\* `Encharge` - Encharge\n\* `Eventee` - Eventee\n\* `Eventzilla` - Eventzilla\n\* `Everhour` - Everhour\n\* `EZOfficeInventory` - EZOfficeInventory\n\* `Factorial` - Factorial\n\* `Fastbill` - Fastbill\n\* `Fastly` - Fastly\n\* `Fauna` - Fauna\n\* `Feishu` - Feishu\n\* `Fillout` - Fillout\n\* `Finage` - Finage\n\* `Firebolt` - Firebolt\n\* `FireHydrant` - FireHydrant\n\* `Fleetio` - Fleetio\n\* `Flexmail` - Flexmail\n\* `Flexport` - Flexport\n\* `FloatApp` - FloatApp\n\* `Flowlu` - Flowlu\n\* `Formbricks` - Formbricks\n\* `FreeAgent` - FreeAgent\n\* `Freightview` - Freightview\n\* `Freshcaller` - Freshcaller\n\* `Freshchat` - Freshchat\n\* `Freshservice` - Freshservice\n\* `Fulcrum` - Fulcrum\n\* `GainsightPx` - GainsightPx\n\* `GitBook` - GitBook\n\* `Glassfrog` - Glassfrog\n\* `Goldcast` - Goldcast\n\* `GoLogin` - GoLogin\n\* `Grafana` - Grafana\n\* `GreytHr` - GreytHr\n\* `Gridly` - Gridly\n\* `Harness` - Harness\n\* `Height` - Height\n\* `Hellobaton` - Hellobaton\n\* `HighLevel` - HighLevel\n\* `HoorayHR` - HoorayHR\n\* `Hubplanner` - Hubplanner\n\* `Humanitix` - Humanitix\n\* `Huntr` - Huntr\n\* `Inflowinventory` - Inflowinventory\n\* `InforNexus` - InforNexus\n\* `Insightful` - Insightful\n\* `Insightly` - Insightly\n\* `Instatus` - Instatus\n\* `Intruder` - Intruder\n\* `Invoiced` - Invoiced\n\* `Invoiceninja` - Invoiceninja\n\* `JamfPro` - JamfPro\n\* `JobNimbus` - JobNimbus\n\* `Jotform` - Jotform\n\* `JudgeMeReviews` - JudgeMeReviews\n\* `JustCall` - JustCall\n\* `JustSift` - JustSift\n\* `K6Cloud` - K6Cloud\n\* `Katana` - Katana\n\* `Keka` - Keka\n\* `Kisi` - Kisi\n\* `Kissmetrics` - Kissmetrics\n\* `Klarna` - Klarna\n\* `Klaus` - Klaus\n\* `Lago` - Lago\n\* `Leadfeeder` - Leadfeeder\n\* `Lemlist` - Lemlist\n\* `LessAnnoyingCRM` - LessAnnoyingCRM\n\* `LinkedinPages` - LinkedinPages\n\* `Linkrunner` - Linkrunner\n\* `Linnworks` - Linnworks\n\* `Lob` - Lob\n\* `Lokalise` - Lokalise\n\* `Looker` - Looker\n\* `Luma` - Luma\n\* `MailerSend` - MailerSend\n\* `Mailosaur` - Mailosaur\n\* `Mailtrap` - Mailtrap\n\* `Mantle` - Mantle\n\* `Mention` - Mention\n\* `MercadoAds` - MercadoAds\n\* `Merge` - Merge\n\* `Metabase` - Metabase\n\* `Metricool` - Metricool\n\* `MicrosoftDataverse` - MicrosoftDataverse\n\* `MicrosoftEntraId` - MicrosoftEntraId\n\* `MicrosoftLists` - MicrosoftLists\n\* `Miro` - Miro\n\* `Missive` - Missive\n\* `MixMax` - MixMax\n\* `Mode` - Mode\n\* `Mux` - Mux\n\* `MyHours` - MyHours\n\* `N8n` - N8n\n\* `Navan` - Navan\n\* `NebiusAI` - NebiusAI\n\* `Nexiopay` - Nexiopay\n\* `NinjaOneRMM` - NinjaOneRMM\n\* `NoCRM` - NoCRM\n\* `NorthpassLMS` - NorthpassLMS\n\* `Nutshell` - Nutshell\n\* `Nylas` - Nylas\n\* `Oncehub` - Oncehub\n\* `Onepagecrm` - Onepagecrm\n\* `OneSignal` - OneSignal\n\* `Onfleet` - Onfleet\n\* `OpinionStage` - OpinionStage\n\* `OPUSWatch` - OPUSWatch\n\* `Orb` - Orb\n\* `Orbit` - Orbit\n\* `Oura` - Oura\n\* `Oveit` - Oveit\n\* `PabblySubscriptionsBilling` - PabblySubscriptionsBilling\n\* `Paperform` - Paperform\n\* `Papersign` - Papersign\n\* `Partnerize` - Partnerize\n\* `PartnerStack` - PartnerStack\n\* `PayFit` - PayFit\n\* `Paystack` - Paystack\n\* `Pennylane` - Pennylane\n\* `Perk` - Perk\n\* `PersistIq` - PersistIq\n\* `Persona` - Persona\n\* `Phyllo` - Phyllo\n\* `Picqer` - Picqer\n\* `Pipeliner` - Pipeliner\n\* `PivotalTracker` - PivotalTracker\n\* `Piwik` - Piwik\n\* `Planhat` - Planhat\n\* `Plausible` - Plausible\n\* `Poplar` - Poplar\n\* `PrestaShop` - PrestaShop\n\* `Pretix` - Pretix\n\* `Primetric` - Primetric\n\* `Printify` - Printify\n\* `Productive` - Productive\n\* `Pylon` - Pylon\n\* `Qonto` - Qonto\n\* `Qualaroo` - Qualaroo\n\* `Railz` - Railz\n\* `RDStationMarketing` - RDStationMarketing\n\* `Recruitee` - Recruitee\n\* `Reddit` - Reddit\n\* `ReferralHero` - ReferralHero\n\* `RentCast` - RentCast\n\* `Repairshopr` - Repairshopr\n\* `ReplyIo` - ReplyIo\n\* `RetailExpress` - RetailExpress\n\* `Retently` - Retently\n\* `RevolutMerchant` - RevolutMerchant\n\* `RocketChat` - RocketChat\n\* `Rocketlane` - Rocketlane\n\* `Rootly` - Rootly\n\* `Ruddr` - Ruddr\n\* `SafetyCulture` - SafetyCulture\n\* `SageHR` - SageHR\n\* `Salesflare` - Salesflare\n\* `SAPFieldglass` - SAPFieldglass\n\* `SavvyCal` - SavvyCal\n\* `Secoda` - Secoda\n\* `Segment` - Segment\n\* `Sendowl` - Sendowl\n\* `SendPulse` - SendPulse\n\* `Senseforce` - Senseforce\n\* `Serpstat` - Serpstat\n\* `Sharetribe` - Sharetribe\n\* `Shippo` - Shippo\n\* `ShopWired` - ShopWired\n\* `Shortio` - Shortio\n\* `Shutterstock` - Shutterstock\n\* `SigmaComputing` - SigmaComputing\n\* `SignNow` - SignNow\n\* `SimpleCast` - SimpleCast\n\* `Simplesat` - Simplesat\n\* `Smaily` - Smaily\n\* `SmartEngage` - SmartEngage\n\* `Smartreach` - Smartreach\n\* `Smartwaiver` - Smartwaiver\n\* `SolarwindsServiceDesk` - SolarwindsServiceDesk\n\* `SonarCloud` - SonarCloud\n\* `SparkPost` - SparkPost\n\* `SplitIo` - SplitIo\n\* `SpotifyAds` - SpotifyAds\n\* `SpotlerCRM` - SpotlerCRM\n\* `Squarespace` - Squarespace\n\* `Statsig` - Statsig\n\* `Statuspage` - Statuspage\n\* `Stigg` - Stigg\n\* `Strava` - Strava\n\* `SurveySparrow` - SurveySparrow\n\* `Survicate` - Survicate\n\* `Svix` - Svix\n\* `Systeme` - Systeme\n\* `Tavus` - Tavus\n\* `Teamtailor` - Teamtailor\n\* `Teamwork` - Teamwork\n\* `Tempo` - Tempo\n\* `Testrail` - Testrail\n\* `Thinkific` - Thinkific\n\* `ThinkificCourses` - ThinkificCourses\n\* `ThriveLearning` - ThriveLearning\n\* `Ticketmaster` - Ticketmaster\n\* `TicketTailor` - TicketTailor\n\* `TickTick` - TickTick\n\* `Timely` - Timely\n\* `Tinyemail` - Tinyemail\n\* `Todoist` - Todoist\n\* `Toggl` - Toggl\n\* `TrackPMS` - TrackPMS\n\* `Tremendous` - Tremendous\n\* `TrustPilot` - TrustPilot\n\* `Twitter` - Twitter\n\* `TyntecSMS` - TyntecSMS\n\* `Unleash` - Unleash\n\* `UpPromote` - UpPromote\n\* `Uptick` - Uptick\n\* `Uservoice` - Uservoice\n\* `Vantage` - Vantage\n\* `Veeqo` - Veeqo\n\* `Vercel` - Vercel\n\* `VismaEconomic` - VismaEconomic\n\* `VWO` - VWO\n\* `Waiteraid` - Waiteraid\n\* `Wasabi` - Wasabi\n\* `WhenIWork` - WhenIWork\n\* `Wordpress` - Wordpress\n\* `Workable` - Workable\n\* `Workflowmax` - Workflowmax\n\* `Workramp` - Workramp\n\* `Wufoo` - Wufoo\n\* `Xsolla` - Xsolla\n\* `YandexMetrica` - YandexMetrica\n\* `Yotpo` - Yotpo\n\* `Ynab` - Ynab\n\* `Younium` - Younium\n\* `YouSign` - YouSign\n\* `YoutubeData` - YoutubeData\n\* `ZapierSupportedStorage` - ZapierSupportedStorage\n\* `ZapSign` - ZapSign\n\* `ZendeskSell` - ZendeskSell\n\* `ZendeskSunshine` - ZendeskSunshine\n\* `Zenefits` - Zenefits\n\* `Zenloop` - Zenloop\n\* `ZohoAnalytics` - ZohoAnalytics\n\* `ZohoBigin` - ZohoBigin\n\* `ZohoBilling` - ZohoBilling\n\* `ZohoBooks` - ZohoBooks\n\* `ZohoCampaign` - ZohoCampaign\n\* `ZohoDesk` - ZohoDesk\n\* `ZohoExpense` - ZohoExpense\n\* `ZohoInventory` - ZohoInventory\n\* `ZohoInvoice` - ZohoInvoice\n\* `ZonkaFeedback` - ZonkaFeedback\n\* `AlphaVantage` - AlphaVantage\n\* `Aviationstack` - Aviationstack\n\* `Bitly` - Bitly\n\* `Blogger` - Blogger\n\* `Breezometer` - Breezometer\n\* `CareQualityCommission` - CareQualityCommission\n\* `Cimis` - Cimis\n\* `CoinApi` - CoinApi\n\* `CoinGecko` - CoinGecko\n\* `CoinMarketCap` - CoinMarketCap\n\* `DingConnect` - DingConnect\n\* `Dockerhub` - Dockerhub\n\* `ExchangeRatesApi` - ExchangeRatesApi\n\* `FinancialModelling` - FinancialModelling\n\* `Finnhub` - Finnhub\n\* `Finnworlds` - Finnworlds\n\* `Giphy` - Giphy\n\* `Gmail` - Gmail\n\* `GNews` - GNews\n\* `GoogleCalendar` - GoogleCalendar\n\* `GoogleClassroom` - GoogleClassroom\n\* `GoogleDirectory` - GoogleDirectory\n\* `GoogleForms` - GoogleForms\n\* `GooglePageSpeedInsights` - GooglePageSpeedInsights\n\* `GoogleTasks` - GoogleTasks\n\* `GoogleWebfonts` - GoogleWebfonts\n\* `GoogleWorkspaceAdminReports` - GoogleWorkspaceAdminReports\n\* `HuggingFace` - HuggingFace\n\* `IlluminaBasespace` - IlluminaBasespace\n\* `Imagga` - Imagga\n\* `Interzoid` - Interzoid\n\* `IP2Whois` - IP2Whois\n\* `KYVE` - KYVE\n\* `Marketstack` - Marketstack\n\* `Mendeley` - Mendeley\n\* `Nasa` - Nasa\n\* `NewYorkTimes` - NewYorkTimes\n\* `NewsApi` - NewsApi\n\* `NewsData` - NewsData\n\* `OpenDataDc` - OpenDataDc\n\* `OpenExchangeRates` - OpenExchangeRates\n\* `OpenAQ` - OpenAQ\n\* `OpenFDA` - OpenFDA\n\* `OpenWeather` - OpenWeather\n\* `Outlook` - Outlook\n\* `Perigon` - Perigon\n\* `Pexels` - Pexels\n\* `Pocket` - Pocket\n\* `Polygon` - Polygon\n\* `PyPI` - PyPI\n\* `Recreation` - Recreation\n\* `RKICovid` - RKICovid\n\* `Rss` - Rss\n\* `SimFin` - SimFin\n\* `StockData` - StockData\n\* `Guardian` - Guardian\n\* `TMDb` - TMDb\n\* `TVMaze` - TVMaze\n\* `TwelveData` - TwelveData\n\* `Ubidots` - Ubidots\n\* `USCensus` - USCensus\n\* `Watchmode` - Watchmode\n\* `WikipediaPageviews` - WikipediaPageviews\n\* `YahooFinance` - YahooFinance\n\* `Clarifai` - Clarifai\n\* `Adapty` - Adapty\n\* `Braintrust` - Braintrust\n\* `StreamElements` - StreamElements\n\* `Streamlabs` - Streamlabs\n\* `Datorama` - Datorama\n\* `Ahrefs` - Ahrefs\n\* `Lightfield` - Lightfield\n\* `Appstack` - Appstack\n\* `Razorpay` - Razorpay\n\* `Neon` - Neon\n\* `NewRelic` - NewRelic\n\* `Custom` - Custom\n\* `Tile38` - Tile38\n\* `Chatwoot` - Chatwoot\n\* `Sanity` - Sanity\n\* `Metronome` - Metronome\n\* `Jobber` - Jobber\n\* `Knock` - Knock\n\* `Leexi` - Leexi\n\* `RB2B` - RB2B\n\* `Superwall` - Superwall'
+ )
+ .describe(
+ "The source type to preview. Only 'Custom' (a user-defined REST API) is supported today.\n\n\* `Ashby` - Ashby\n\* `Supabase` - Supabase\n\* `CustomerIO` - CustomerIO\n\* `Github` - Github\n\* `Stripe` - Stripe\n\* `Hubspot` - Hubspot\n\* `Postgres` - Postgres\n\* `Zendesk` - Zendesk\n\* `Snowflake` - Snowflake\n\* `Salesforce` - Salesforce\n\* `MySQL` - MySQL\n\* `MongoDB` - MongoDB\n\* `MSSQL` - MSSQL\n\* `Vitally` - Vitally\n\* `BigQuery` - BigQuery\n\* `Chargebee` - Chargebee\n\* `Clerk` - Clerk\n\* `GoogleAds` - GoogleAds\n\* `GoogleSearchConsole` - GoogleSearchConsole\n\* `TemporalIO` - TemporalIO\n\* `DoIt` - DoIt\n\* `GoogleSheets` - GoogleSheets\n\* `MetaAds` - MetaAds\n\* `Klaviyo` - Klaviyo\n\* `Mailchimp` - Mailchimp\n\* `Braze` - Braze\n\* `Mailjet` - Mailjet\n\* `Redshift` - Redshift\n\* `Polar` - Polar\n\* `RevenueCat` - RevenueCat\n\* `LinkedinAds` - LinkedinAds\n\* `RedditAds` - RedditAds\n\* `TikTokAds` - TikTokAds\n\* `BingAds` - BingAds\n\* `Shopify` - Shopify\n\* `Attio` - Attio\n\* `SnapchatAds` - SnapchatAds\n\* `Linear` - Linear\n\* `Intercom` - Intercom\n\* `Amplitude` - Amplitude\n\* `Mixpanel` - Mixpanel\n\* `Jira` - Jira\n\* `ActiveCampaign` - ActiveCampaign\n\* `Marketo` - Marketo\n\* `Adjust` - Adjust\n\* `AppsFlyer` - AppsFlyer\n\* `Freshdesk` - Freshdesk\n\* `GoogleAnalytics` - GoogleAnalytics\n\* `Pipedrive` - Pipedrive\n\* `SendGrid` - SendGrid\n\* `Slack` - Slack\n\* `PagerDuty` - PagerDuty\n\* `Asana` - Asana\n\* `Notion` - Notion\n\* `Airtable` - Airtable\n\* `Greenhouse` - Greenhouse\n\* `BambooHR` - BambooHR\n\* `Lever` - Lever\n\* `GitLab` - GitLab\n\* `Datadog` - Datadog\n\* `Sentry` - Sentry\n\* `Pendo` - Pendo\n\* `FullStory` - FullStory\n\* `AmazonAds` - AmazonAds\n\* `PinterestAds` - PinterestAds\n\* `AppleSearchAds` - AppleSearchAds\n\* `QuickBooks` - QuickBooks\n\* `Xero` - Xero\n\* `NetSuite` - NetSuite\n\* `WooCommerce` - WooCommerce\n\* `BigCommerce` - BigCommerce\n\* `PayPal` - PayPal\n\* `Square` - Square\n\* `Zoom` - Zoom\n\* `Trello` - Trello\n\* `Monday` - Monday\n\* `ClickUp` - ClickUp\n\* `Confluence` - Confluence\n\* `Recurly` - Recurly\n\* `SalesLoft` - SalesLoft\n\* `Outreach` - Outreach\n\* `Gong` - Gong\n\* `Calendly` - Calendly\n\* `Typeform` - Typeform\n\* `Iterable` - Iterable\n\* `ZohoCRM` - ZohoCRM\n\* `Close` - Close\n\* `Oracle` - Oracle\n\* `DynamoDB` - DynamoDB\n\* `Elasticsearch` - Elasticsearch\n\* `Kafka` - Kafka\n\* `LaunchDarkly` - LaunchDarkly\n\* `Braintree` - Braintree\n\* `Recharge` - Recharge\n\* `HelpScout` - HelpScout\n\* `Gorgias` - Gorgias\n\* `Instagram` - Instagram\n\* `YouTubeAnalytics` - YouTubeAnalytics\n\* `FacebookPages` - FacebookPages\n\* `TwitterAds` - TwitterAds\n\* `Workday` - Workday\n\* `ServiceNow` - ServiceNow\n\* `Pardot` - Pardot\n\* `Copper` - Copper\n\* `Front` - Front\n\* `ChartMogul` - ChartMogul\n\* `Zuora` - Zuora\n\* `Paddle` - Paddle\n\* `CircleCI` - CircleCI\n\* `CockroachDB` - CockroachDB\n\* `Firebase` - Firebase\n\* `AzureBlob` - AzureBlob\n\* `GoogleDrive` - GoogleDrive\n\* `OneDrive` - OneDrive\n\* `SharePoint` - SharePoint\n\* `Box` - Box\n\* `SFTP` - SFTP\n\* `MicrosoftTeams` - MicrosoftTeams\n\* `Aircall` - Aircall\n\* `Webflow` - Webflow\n\* `Okta` - Okta\n\* `Auth0` - Auth0\n\* `Productboard` - Productboard\n\* `Smartsheet` - Smartsheet\n\* `Wrike` - Wrike\n\* `Plaid` - Plaid\n\* `SurveyMonkey` - SurveyMonkey\n\* `Eventbrite` - Eventbrite\n\* `RingCentral` - RingCentral\n\* `Twilio` - Twilio\n\* `Freshsales` - Freshsales\n\* `Shortcut` - Shortcut\n\* `ConvertKit` - ConvertKit\n\* `Drip` - Drip\n\* `CampaignMonitor` - CampaignMonitor\n\* `MailerLite` - MailerLite\n\* `Omnisend` - Omnisend\n\* `Brevo` - Brevo\n\* `Postmark` - Postmark\n\* `Granola` - Granola\n\* `BuildBetter` - BuildBetter\n\* `Convex` - Convex\n\* `ClickHouse` - ClickHouse\n\* `Plain` - Plain\n\* `Resend` - Resend\n\* `PgAnalyze` - PgAnalyze\n\* `WorkOS` - WorkOS\n\* `AmazonS3` - AmazonS3\n\* `GoogleCloudStorage` - GoogleCloudStorage\n\* `Databricks` - Databricks\n\* `Dynamics365` - Dynamics365\n\* `SalesforceMarketingCloud` - SalesforceMarketingCloud\n\* `Db2` - Db2\n\* `Heap` - Heap\n\* `AdobeAnalytics` - AdobeAnalytics\n\* `Matomo` - Matomo\n\* `Optimizely` - Optimizely\n\* `Adyen` - Adyen\n\* `GoCardless` - GoCardless\n\* `Mollie` - Mollie\n\* `CheckoutCom` - CheckoutCom\n\* `Branch` - Branch\n\* `Criteo` - Criteo\n\* `Outbrain` - Outbrain\n\* `Taboola` - Taboola\n\* `AdRoll` - AdRoll\n\* `DisplayVideo360` - DisplayVideo360\n\* `GoogleAdManager` - GoogleAdManager\n\* `CampaignManager360` - CampaignManager360\n\* `SearchAds360` - SearchAds360\n\* `AdobeCommerce` - AdobeCommerce\n\* `AmazonSellingPartner` - AmazonSellingPartner\n\* `Ebay` - Ebay\n\* `Commercetools` - Commercetools\n\* `LightspeedRetail` - LightspeedRetail\n\* `ShipStation` - ShipStation\n\* `ConstantContact` - ConstantContact\n\* `Mailgun` - Mailgun\n\* `Eloqua` - Eloqua\n\* `Sailthru` - Sailthru\n\* `Ortto` - Ortto\n\* `Attentive` - Attentive\n\* `Kustomer` - Kustomer\n\* `Dixa` - Dixa\n\* `Gladly` - Gladly\n\* `Qualtrics` - Qualtrics\n\* `Delighted` - Delighted\n\* `AzureDevOps` - AzureDevOps\n\* `Rollbar` - Rollbar\n\* `Opsgenie` - Opsgenie\n\* `IncidentIo` - IncidentIo\n\* `Pingdom` - Pingdom\n\* `Cloudflare` - Cloudflare\n\* `CosmosDB` - CosmosDB\n\* `PlanetScale` - PlanetScale\n\* `SapHana` - SapHana\n\* `Rippling` - Rippling\n\* `HiBob` - HiBob\n\* `Personio` - Personio\n\* `Deel` - Deel\n\* `AdpWorkforceNow` - AdpWorkforceNow\n\* `Paylocity` - Paylocity\n\* `Gusto` - Gusto\n\* `CultureAmp` - CultureAmp\n\* `Lattice` - Lattice\n\* `SageIntacct` - SageIntacct\n\* `FreshBooks` - FreshBooks\n\* `Expensify` - Expensify\n\* `Ramp` - Ramp\n\* `Brex` - Brex\n\* `Coupa` - Coupa\n\* `SapConcur` - SapConcur\n\* `Apollo` - Apollo\n\* `Crunchbase` - Crunchbase\n\* `ZoomInfo` - ZoomInfo\n\* `Clari` - Clari\n\* `Chorus` - Chorus\n\* `Coda` - Coda\n\* `Guru` - Guru\n\* `Dropbox` - Dropbox\n\* `Docusign` - Docusign\n\* `PandaDoc` - PandaDoc\n\* `SapErp` - SapErp\n\* `SapSuccessFactors` - SapSuccessFactors\n\* `OracleEbs` - OracleEbs\n\* `OracleFusion` - OracleFusion\n\* `AmazonSNS` - AmazonSNS\n\* `AmazonEventBridge` - AmazonEventBridge\n\* `AmazonSQS` - AmazonSQS\n\* `AmazonKinesis` - AmazonKinesis\n\* `AmazonCloudWatch` - AmazonCloudWatch\n\* `OpenAIAds` - OpenAIAds\n\* `OneHundredMs` - OneHundredMs\n\* `SevenShifts` - SevenShifts\n\* `AcuityScheduling` - AcuityScheduling\n\* `AgileCRM` - AgileCRM\n\* `Aha` - Aha\n\* `Airbyte` - Airbyte\n\* `Akeneo` - Akeneo\n\* `Algolia` - Algolia\n\* `AlpacaBrokerAPI` - AlpacaBrokerAPI\n\* `ApifyDataset` - ApifyDataset\n\* `Appcues` - Appcues\n\* `Appfigures` - Appfigures\n\* `Appfollow` - Appfollow\n\* `Apptivo` - Apptivo\n\* `AssemblyAI` - AssemblyAI\n\* `Awin` - Awin\n\* `AwsCloudTrail` - AwsCloudTrail\n\* `AzureTableStorage` - AzureTableStorage\n\* `Babelforce` - Babelforce\n\* `Basecamp` - Basecamp\n\* `Beamer` - Beamer\n\* `BigMailer` - BigMailer\n\* `Bluetally` - Bluetally\n\* `BoldSign` - BoldSign\n\* `BreezyHR` - BreezyHR\n\* `Bugsnag` - Bugsnag\n\* `Buildkite` - Buildkite\n\* `Bunny` - Bunny\n\* `Buzzsprout` - Buzzsprout\n\* `CalCom` - CalCom\n\* `CallRail` - CallRail\n\* `Campayn` - Campayn\n\* `Canny` - Canny\n\* `CapsuleCRM` - CapsuleCRM\n\* `CaptainData` - CaptainData\n\* `CartCom` - CartCom\n\* `CastorEDC` - CastorEDC\n\* `Chameleon` - Chameleon\n\* `Chargedesk` - Chargedesk\n\* `Chargify` - Chargify\n\* `Chift` - Chift\n\* `Churnkey` - Churnkey\n\* `Cin7` - Cin7\n\* `CiscoMeraki` - CiscoMeraki\n\* `Clazar` - Clazar\n\* `Clockify` - Clockify\n\* `Clockodo` - Clockodo\n\* `Cloudbeds` - Cloudbeds\n\* `Coassemble` - Coassemble\n\* `Codefresh` - Codefresh\n\* `Concord` - Concord\n\* `ConfigCat` - ConfigCat\n\* `Couchbase` - Couchbase\n\* `Curve` - Curve\n\* `Customerly` - Customerly\n\* `Datascope` - Datascope\n\* `Dbt` - Dbt\n\* `Deputy` - Deputy\n\* `DevinAI` - DevinAI\n\* `Docuseal` - Docuseal\n\* `Dolibarr` - Dolibarr\n\* `Dremio` - Dremio\n\* `DropboxSign` - DropboxSign\n\* `Dwolla` - Dwolla\n\* `EConomic` - EConomic\n\* `Easypost` - Easypost\n\* `Easypromos` - Easypromos\n\* `Elasticemail` - Elasticemail\n\* `EmailOctopus` - EmailOctopus\n\* `EmploymentHero` - EmploymentHero\n\* `Encharge` - Encharge\n\* `Eventee` - Eventee\n\* `Eventzilla` - Eventzilla\n\* `Everhour` - Everhour\n\* `EZOfficeInventory` - EZOfficeInventory\n\* `Factorial` - Factorial\n\* `Fastbill` - Fastbill\n\* `Fastly` - Fastly\n\* `Fauna` - Fauna\n\* `Feishu` - Feishu\n\* `Fillout` - Fillout\n\* `Finage` - Finage\n\* `Firebolt` - Firebolt\n\* `FireHydrant` - FireHydrant\n\* `Fleetio` - Fleetio\n\* `Flexmail` - Flexmail\n\* `Flexport` - Flexport\n\* `FloatApp` - FloatApp\n\* `Flowlu` - Flowlu\n\* `Formbricks` - Formbricks\n\* `FreeAgent` - FreeAgent\n\* `Freightview` - Freightview\n\* `Freshcaller` - Freshcaller\n\* `Freshchat` - Freshchat\n\* `Freshservice` - Freshservice\n\* `Fulcrum` - Fulcrum\n\* `GainsightPx` - GainsightPx\n\* `GitBook` - GitBook\n\* `Glassfrog` - Glassfrog\n\* `Goldcast` - Goldcast\n\* `GoLogin` - GoLogin\n\* `Grafana` - Grafana\n\* `GreytHr` - GreytHr\n\* `Gridly` - Gridly\n\* `Harness` - Harness\n\* `Height` - Height\n\* `Hellobaton` - Hellobaton\n\* `HighLevel` - HighLevel\n\* `HoorayHR` - HoorayHR\n\* `Hubplanner` - Hubplanner\n\* `Humanitix` - Humanitix\n\* `Huntr` - Huntr\n\* `Inflowinventory` - Inflowinventory\n\* `InforNexus` - InforNexus\n\* `Insightful` - Insightful\n\* `Insightly` - Insightly\n\* `Instatus` - Instatus\n\* `Intruder` - Intruder\n\* `Invoiced` - Invoiced\n\* `Invoiceninja` - Invoiceninja\n\* `JamfPro` - JamfPro\n\* `JobNimbus` - JobNimbus\n\* `Jotform` - Jotform\n\* `JudgeMeReviews` - JudgeMeReviews\n\* `JustCall` - JustCall\n\* `JustSift` - JustSift\n\* `K6Cloud` - K6Cloud\n\* `Katana` - Katana\n\* `Keka` - Keka\n\* `Kisi` - Kisi\n\* `Kissmetrics` - Kissmetrics\n\* `Klarna` - Klarna\n\* `Klaus` - Klaus\n\* `Lago` - Lago\n\* `Leadfeeder` - Leadfeeder\n\* `Lemlist` - Lemlist\n\* `LessAnnoyingCRM` - LessAnnoyingCRM\n\* `LinkedinPages` - LinkedinPages\n\* `Linkrunner` - Linkrunner\n\* `Linnworks` - Linnworks\n\* `Lob` - Lob\n\* `Lokalise` - Lokalise\n\* `Looker` - Looker\n\* `Luma` - Luma\n\* `MailerSend` - MailerSend\n\* `Mailosaur` - Mailosaur\n\* `Mailtrap` - Mailtrap\n\* `Mantle` - Mantle\n\* `Mention` - Mention\n\* `MercadoAds` - MercadoAds\n\* `Merge` - Merge\n\* `Metabase` - Metabase\n\* `Metricool` - Metricool\n\* `MicrosoftDataverse` - MicrosoftDataverse\n\* `MicrosoftEntraId` - MicrosoftEntraId\n\* `MicrosoftLists` - MicrosoftLists\n\* `Miro` - Miro\n\* `Missive` - Missive\n\* `MixMax` - MixMax\n\* `Mode` - Mode\n\* `Mux` - Mux\n\* `MyHours` - MyHours\n\* `N8n` - N8n\n\* `Navan` - Navan\n\* `NebiusAI` - NebiusAI\n\* `Nexiopay` - Nexiopay\n\* `NinjaOneRMM` - NinjaOneRMM\n\* `NoCRM` - NoCRM\n\* `NorthpassLMS` - NorthpassLMS\n\* `Nutshell` - Nutshell\n\* `Nylas` - Nylas\n\* `Oncehub` - Oncehub\n\* `Onepagecrm` - Onepagecrm\n\* `OneSignal` - OneSignal\n\* `Onfleet` - Onfleet\n\* `OpinionStage` - OpinionStage\n\* `OPUSWatch` - OPUSWatch\n\* `Orb` - Orb\n\* `Orbit` - Orbit\n\* `Oura` - Oura\n\* `Oveit` - Oveit\n\* `PabblySubscriptionsBilling` - PabblySubscriptionsBilling\n\* `Paperform` - Paperform\n\* `Papersign` - Papersign\n\* `Partnerize` - Partnerize\n\* `PartnerStack` - PartnerStack\n\* `PayFit` - PayFit\n\* `Paystack` - Paystack\n\* `Pennylane` - Pennylane\n\* `Perk` - Perk\n\* `PersistIq` - PersistIq\n\* `Persona` - Persona\n\* `Phyllo` - Phyllo\n\* `Picqer` - Picqer\n\* `Pipeliner` - Pipeliner\n\* `PivotalTracker` - PivotalTracker\n\* `Piwik` - Piwik\n\* `Planhat` - Planhat\n\* `Plausible` - Plausible\n\* `Poplar` - Poplar\n\* `PrestaShop` - PrestaShop\n\* `Pretix` - Pretix\n\* `Primetric` - Primetric\n\* `Printify` - Printify\n\* `Productive` - Productive\n\* `Pylon` - Pylon\n\* `Qonto` - Qonto\n\* `Qualaroo` - Qualaroo\n\* `Railz` - Railz\n\* `RDStationMarketing` - RDStationMarketing\n\* `Recruitee` - Recruitee\n\* `Reddit` - Reddit\n\* `ReferralHero` - ReferralHero\n\* `RentCast` - RentCast\n\* `Repairshopr` - Repairshopr\n\* `ReplyIo` - ReplyIo\n\* `RetailExpress` - RetailExpress\n\* `Retently` - Retently\n\* `RevolutMerchant` - RevolutMerchant\n\* `RocketChat` - RocketChat\n\* `Rocketlane` - Rocketlane\n\* `Rootly` - Rootly\n\* `Ruddr` - Ruddr\n\* `SafetyCulture` - SafetyCulture\n\* `SageHR` - SageHR\n\* `Salesflare` - Salesflare\n\* `SAPFieldglass` - SAPFieldglass\n\* `SavvyCal` - SavvyCal\n\* `Secoda` - Secoda\n\* `Segment` - Segment\n\* `Sendowl` - Sendowl\n\* `SendPulse` - SendPulse\n\* `Senseforce` - Senseforce\n\* `Serpstat` - Serpstat\n\* `Sharetribe` - Sharetribe\n\* `Shippo` - Shippo\n\* `ShopWired` - ShopWired\n\* `Shortio` - Shortio\n\* `Shutterstock` - Shutterstock\n\* `SigmaComputing` - SigmaComputing\n\* `SignNow` - SignNow\n\* `SimpleCast` - SimpleCast\n\* `Simplesat` - Simplesat\n\* `Smaily` - Smaily\n\* `SmartEngage` - SmartEngage\n\* `Smartreach` - Smartreach\n\* `Smartwaiver` - Smartwaiver\n\* `SolarwindsServiceDesk` - SolarwindsServiceDesk\n\* `SonarCloud` - SonarCloud\n\* `SparkPost` - SparkPost\n\* `SplitIo` - SplitIo\n\* `SpotifyAds` - SpotifyAds\n\* `SpotlerCRM` - SpotlerCRM\n\* `Squarespace` - Squarespace\n\* `Statsig` - Statsig\n\* `Statuspage` - Statuspage\n\* `Stigg` - Stigg\n\* `Strava` - Strava\n\* `SurveySparrow` - SurveySparrow\n\* `Survicate` - Survicate\n\* `Svix` - Svix\n\* `Systeme` - Systeme\n\* `Tavus` - Tavus\n\* `Teamtailor` - Teamtailor\n\* `Teamwork` - Teamwork\n\* `Tempo` - Tempo\n\* `Testrail` - Testrail\n\* `Thinkific` - Thinkific\n\* `ThinkificCourses` - ThinkificCourses\n\* `ThriveLearning` - ThriveLearning\n\* `Ticketmaster` - Ticketmaster\n\* `TicketTailor` - TicketTailor\n\* `TickTick` - TickTick\n\* `Timely` - Timely\n\* `Tinyemail` - Tinyemail\n\* `Todoist` - Todoist\n\* `Toggl` - Toggl\n\* `TrackPMS` - TrackPMS\n\* `Tremendous` - Tremendous\n\* `TrustPilot` - TrustPilot\n\* `Twitter` - Twitter\n\* `TyntecSMS` - TyntecSMS\n\* `Unleash` - Unleash\n\* `UpPromote` - UpPromote\n\* `Uptick` - Uptick\n\* `Uservoice` - Uservoice\n\* `Vantage` - Vantage\n\* `Veeqo` - Veeqo\n\* `Vercel` - Vercel\n\* `VismaEconomic` - VismaEconomic\n\* `VWO` - VWO\n\* `Waiteraid` - Waiteraid\n\* `Wasabi` - Wasabi\n\* `WhenIWork` - WhenIWork\n\* `Wordpress` - Wordpress\n\* `Workable` - Workable\n\* `Workflowmax` - Workflowmax\n\* `Workramp` - Workramp\n\* `Wufoo` - Wufoo\n\* `Xsolla` - Xsolla\n\* `YandexMetrica` - YandexMetrica\n\* `Yotpo` - Yotpo\n\* `Ynab` - Ynab\n\* `Younium` - Younium\n\* `YouSign` - YouSign\n\* `YoutubeData` - YoutubeData\n\* `ZapierSupportedStorage` - ZapierSupportedStorage\n\* `ZapSign` - ZapSign\n\* `ZendeskSell` - ZendeskSell\n\* `ZendeskSunshine` - ZendeskSunshine\n\* `Zenefits` - Zenefits\n\* `Zenloop` - Zenloop\n\* `ZohoAnalytics` - ZohoAnalytics\n\* `ZohoBigin` - ZohoBigin\n\* `ZohoBilling` - ZohoBilling\n\* `ZohoBooks` - ZohoBooks\n\* `ZohoCampaign` - ZohoCampaign\n\* `ZohoDesk` - ZohoDesk\n\* `ZohoExpense` - ZohoExpense\n\* `ZohoInventory` - ZohoInventory\n\* `ZohoInvoice` - ZohoInvoice\n\* `ZonkaFeedback` - ZonkaFeedback\n\* `AlphaVantage` - AlphaVantage\n\* `Aviationstack` - Aviationstack\n\* `Bitly` - Bitly\n\* `Blogger` - Blogger\n\* `Breezometer` - Breezometer\n\* `CareQualityCommission` - CareQualityCommission\n\* `Cimis` - Cimis\n\* `CoinApi` - CoinApi\n\* `CoinGecko` - CoinGecko\n\* `CoinMarketCap` - CoinMarketCap\n\* `DingConnect` - DingConnect\n\* `Dockerhub` - Dockerhub\n\* `ExchangeRatesApi` - ExchangeRatesApi\n\* `FinancialModelling` - FinancialModelling\n\* `Finnhub` - Finnhub\n\* `Finnworlds` - Finnworlds\n\* `Giphy` - Giphy\n\* `Gmail` - Gmail\n\* `GNews` - GNews\n\* `GoogleCalendar` - GoogleCalendar\n\* `GoogleClassroom` - GoogleClassroom\n\* `GoogleDirectory` - GoogleDirectory\n\* `GoogleForms` - GoogleForms\n\* `GooglePageSpeedInsights` - GooglePageSpeedInsights\n\* `GoogleTasks` - GoogleTasks\n\* `GoogleWebfonts` - GoogleWebfonts\n\* `GoogleWorkspaceAdminReports` - GoogleWorkspaceAdminReports\n\* `HuggingFace` - HuggingFace\n\* `IlluminaBasespace` - IlluminaBasespace\n\* `Imagga` - Imagga\n\* `Interzoid` - Interzoid\n\* `IP2Whois` - IP2Whois\n\* `KYVE` - KYVE\n\* `Marketstack` - Marketstack\n\* `Mendeley` - Mendeley\n\* `Nasa` - Nasa\n\* `NewYorkTimes` - NewYorkTimes\n\* `NewsApi` - NewsApi\n\* `NewsData` - NewsData\n\* `OpenDataDc` - OpenDataDc\n\* `OpenExchangeRates` - OpenExchangeRates\n\* `OpenAQ` - OpenAQ\n\* `OpenFDA` - OpenFDA\n\* `OpenWeather` - OpenWeather\n\* `Outlook` - Outlook\n\* `Perigon` - Perigon\n\* `Pexels` - Pexels\n\* `Pocket` - Pocket\n\* `Polygon` - Polygon\n\* `PyPI` - PyPI\n\* `Recreation` - Recreation\n\* `RKICovid` - RKICovid\n\* `Rss` - Rss\n\* `SimFin` - SimFin\n\* `StockData` - StockData\n\* `Guardian` - Guardian\n\* `TMDb` - TMDb\n\* `TVMaze` - TVMaze\n\* `TwelveData` - TwelveData\n\* `Ubidots` - Ubidots\n\* `USCensus` - USCensus\n\* `Watchmode` - Watchmode\n\* `WikipediaPageviews` - WikipediaPageviews\n\* `YahooFinance` - YahooFinance\n\* `Clarifai` - Clarifai\n\* `Adapty` - Adapty\n\* `Braintrust` - Braintrust\n\* `StreamElements` - StreamElements\n\* `Streamlabs` - Streamlabs\n\* `Datorama` - Datorama\n\* `Ahrefs` - Ahrefs\n\* `Lightfield` - Lightfield\n\* `Appstack` - Appstack\n\* `Razorpay` - Razorpay\n\* `Neon` - Neon\n\* `NewRelic` - NewRelic\n\* `Custom` - Custom\n\* `Tile38` - Tile38\n\* `Chatwoot` - Chatwoot\n\* `Sanity` - Sanity\n\* `Metronome` - Metronome\n\* `Jobber` - Jobber\n\* `Knock` - Knock\n\* `Leexi` - Leexi\n\* `RB2B` - RB2B\n\* `Superwall` - Superwall"
+ ),
+ payload: zod
+ .record(zod.string(), zod.unknown())
+ .optional()
+ .describe(
+ "Source config as flat keys. For source_type 'Custom': 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the manifest's declared auth type — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic). Secrets stay in these auth_\* keys, never inline in the manifest."
+ ),
+ resource_name: zod
+ .string()
+ .describe(
+ 'Which manifest resource (table) to read a sample from — one of the resource names in manifest_json.'
+ ),
+ limit: zod
+ .number()
+ .min(1)
+ .max(externalDataSourcesPreviewResourceCreateBodyLimitMax)
+ .default(externalDataSourcesPreviewResourceCreateBodyLimitDefault)
+ .describe('Maximum sample rows to return (1–50). Defaults to 10.'),
+})
+
/**
* One-shot data warehouse source setup.
*
diff --git a/products/warehouse_sources/mcp/tools.yaml b/products/warehouse_sources/mcp/tools.yaml
index 0106171d4249..4364b602e848 100644
--- a/products/warehouse_sources/mcp/tools.yaml
+++ b/products/warehouse_sources/mcp/tools.yaml
@@ -383,6 +383,9 @@ tools:
the source_type or access_method after creation. Avoid sending new connection credentials inline here — to
rotate or fix credentials, point the user at 'data-warehouse-source-connect-link' so they re-enter them
securely in their browser rather than pasting secrets into the chat.
+ external-data-sources-preview-resource-create:
+ operation: external_data_sources_preview_resource_create
+ enabled: false
external-data-sources-refresh-schemas:
operation: external_data_sources_refresh_schemas_create
enabled: true
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 0aef51c2b9f9..9716564c3fd5 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -3414,6 +3414,20 @@
"readOnlyHint": false
}
},
+ "external-data-sources-preview-resource": {
+ "description": "Read a small live sample of rows for one resource (table) of a Custom REST source, so you can verify the manifest's data_selector, primary_key, and incremental cursor_path against real data BEFORE creating the source. Only source_type 'Custom' is supported. Pass source_type, a payload object ({manifest_json, plus the credential for the manifest's auth type — auth_token | auth_api_key | auth_password}), the resource_name to sample, and an optional limit (1–50, default 10). Returns {rows, row_count, columns (name + inferred JSON type), error}. Manifest, validation, and SSRF problems return 400; a live fetch failure returns 200 with `error` set and empty rows. Use external-data-sources-db-schema first to list the resource names and detected cursors.",
+ "category": "Data warehouse",
+ "feature": "data_warehouse",
+ "summary": "Preview sample rows for a Custom REST source resource",
+ "title": "Preview rows for a Custom REST source resource",
+ "required_scopes": ["external_data_source:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"external-data-sources-refresh-schemas": {
"description": "Fetch the latest table list from the remote database and create schema entries for any new tables found. Does not trigger a data sync. Use this after adding new tables to a source database to make them available for syncing.",
"category": "Warehouse sources",
diff --git a/services/mcp/schema/tool-definitions.json b/services/mcp/schema/tool-definitions.json
index 42680d7204cf..55863fb42dc2 100644
--- a/services/mcp/schema/tool-definitions.json
+++ b/services/mcp/schema/tool-definitions.json
@@ -548,6 +548,20 @@
"readOnlyHint": true
}
},
+ "external-data-sources-preview-resource": {
+ "description": "Read a small live sample of rows for one resource (table) of a Custom REST source, so you can verify the manifest's data_selector, primary_key, and incremental cursor_path against real data BEFORE creating the source. Only source_type 'Custom' is supported. Pass source_type, a payload object ({manifest_json, plus the credential for the manifest's auth type — auth_token | auth_api_key | auth_password}), the resource_name to sample, and an optional limit (1–50, default 10). Returns {rows, row_count, columns (name + inferred JSON type), error}. Manifest, validation, and SSRF problems return 400; a live fetch failure returns 200 with `error` set and empty rows. Use external-data-sources-db-schema first to list the resource names and detected cursors.",
+ "category": "Data warehouse",
+ "feature": "data_warehouse",
+ "summary": "Preview sample rows for a Custom REST source resource",
+ "title": "Preview rows for a Custom REST source resource",
+ "required_scopes": ["external_data_source:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"external-data-sync-logs": {
"description": "Get sync job logs for a data warehouse table schema. Returns log entries from the log_entries ClickHouse table, filtered by schema ID and optionally by a specific job's workflow_run_id. Use external-data-sources-jobs to find job IDs and workflow_run_ids. Supports filtering by log level (DEBUG, INFO, WARNING, ERROR) and message search.",
"category": "Data warehouse",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index a731dd79a7aa..01e9a39250e1 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -48098,6 +48098,690 @@ export namespace Schemas {
Mapped: 'mapped',
} as const;
+ export interface SourcePreviewColumn {
+ /** Column name as it appears in the previewed rows. */
+ name: string;
+ /** JSON type inferred from the first non-null value: string, integer, number, boolean, object, array, or null. */
+ type: string;
+ }
+
+ /**
+ * Source config as flat keys. For source_type 'Custom': 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the manifest's declared auth type — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic). Secrets stay in these auth_* keys, never inline in the manifest.
+ */
+ export type SourcePreviewRequestPayload = { [key: string]: unknown };
+
+ export interface SourcePreviewRequest {
+ /** The source type to preview. Only 'Custom' (a user-defined REST API) is supported today.
+ *
+ * * `Ashby` - Ashby
+ * * `Supabase` - Supabase
+ * * `CustomerIO` - CustomerIO
+ * * `Github` - Github
+ * * `Stripe` - Stripe
+ * * `Hubspot` - Hubspot
+ * * `Postgres` - Postgres
+ * * `Zendesk` - Zendesk
+ * * `Snowflake` - Snowflake
+ * * `Salesforce` - Salesforce
+ * * `MySQL` - MySQL
+ * * `MongoDB` - MongoDB
+ * * `MSSQL` - MSSQL
+ * * `Vitally` - Vitally
+ * * `BigQuery` - BigQuery
+ * * `Chargebee` - Chargebee
+ * * `Clerk` - Clerk
+ * * `GoogleAds` - GoogleAds
+ * * `GoogleSearchConsole` - GoogleSearchConsole
+ * * `TemporalIO` - TemporalIO
+ * * `DoIt` - DoIt
+ * * `GoogleSheets` - GoogleSheets
+ * * `MetaAds` - MetaAds
+ * * `Klaviyo` - Klaviyo
+ * * `Mailchimp` - Mailchimp
+ * * `Braze` - Braze
+ * * `Mailjet` - Mailjet
+ * * `Redshift` - Redshift
+ * * `Polar` - Polar
+ * * `RevenueCat` - RevenueCat
+ * * `LinkedinAds` - LinkedinAds
+ * * `RedditAds` - RedditAds
+ * * `TikTokAds` - TikTokAds
+ * * `BingAds` - BingAds
+ * * `Shopify` - Shopify
+ * * `Attio` - Attio
+ * * `SnapchatAds` - SnapchatAds
+ * * `Linear` - Linear
+ * * `Intercom` - Intercom
+ * * `Amplitude` - Amplitude
+ * * `Mixpanel` - Mixpanel
+ * * `Jira` - Jira
+ * * `ActiveCampaign` - ActiveCampaign
+ * * `Marketo` - Marketo
+ * * `Adjust` - Adjust
+ * * `AppsFlyer` - AppsFlyer
+ * * `Freshdesk` - Freshdesk
+ * * `GoogleAnalytics` - GoogleAnalytics
+ * * `Pipedrive` - Pipedrive
+ * * `SendGrid` - SendGrid
+ * * `Slack` - Slack
+ * * `PagerDuty` - PagerDuty
+ * * `Asana` - Asana
+ * * `Notion` - Notion
+ * * `Airtable` - Airtable
+ * * `Greenhouse` - Greenhouse
+ * * `BambooHR` - BambooHR
+ * * `Lever` - Lever
+ * * `GitLab` - GitLab
+ * * `Datadog` - Datadog
+ * * `Sentry` - Sentry
+ * * `Pendo` - Pendo
+ * * `FullStory` - FullStory
+ * * `AmazonAds` - AmazonAds
+ * * `PinterestAds` - PinterestAds
+ * * `AppleSearchAds` - AppleSearchAds
+ * * `QuickBooks` - QuickBooks
+ * * `Xero` - Xero
+ * * `NetSuite` - NetSuite
+ * * `WooCommerce` - WooCommerce
+ * * `BigCommerce` - BigCommerce
+ * * `PayPal` - PayPal
+ * * `Square` - Square
+ * * `Zoom` - Zoom
+ * * `Trello` - Trello
+ * * `Monday` - Monday
+ * * `ClickUp` - ClickUp
+ * * `Confluence` - Confluence
+ * * `Recurly` - Recurly
+ * * `SalesLoft` - SalesLoft
+ * * `Outreach` - Outreach
+ * * `Gong` - Gong
+ * * `Calendly` - Calendly
+ * * `Typeform` - Typeform
+ * * `Iterable` - Iterable
+ * * `ZohoCRM` - ZohoCRM
+ * * `Close` - Close
+ * * `Oracle` - Oracle
+ * * `DynamoDB` - DynamoDB
+ * * `Elasticsearch` - Elasticsearch
+ * * `Kafka` - Kafka
+ * * `LaunchDarkly` - LaunchDarkly
+ * * `Braintree` - Braintree
+ * * `Recharge` - Recharge
+ * * `HelpScout` - HelpScout
+ * * `Gorgias` - Gorgias
+ * * `Instagram` - Instagram
+ * * `YouTubeAnalytics` - YouTubeAnalytics
+ * * `FacebookPages` - FacebookPages
+ * * `TwitterAds` - TwitterAds
+ * * `Workday` - Workday
+ * * `ServiceNow` - ServiceNow
+ * * `Pardot` - Pardot
+ * * `Copper` - Copper
+ * * `Front` - Front
+ * * `ChartMogul` - ChartMogul
+ * * `Zuora` - Zuora
+ * * `Paddle` - Paddle
+ * * `CircleCI` - CircleCI
+ * * `CockroachDB` - CockroachDB
+ * * `Firebase` - Firebase
+ * * `AzureBlob` - AzureBlob
+ * * `GoogleDrive` - GoogleDrive
+ * * `OneDrive` - OneDrive
+ * * `SharePoint` - SharePoint
+ * * `Box` - Box
+ * * `SFTP` - SFTP
+ * * `MicrosoftTeams` - MicrosoftTeams
+ * * `Aircall` - Aircall
+ * * `Webflow` - Webflow
+ * * `Okta` - Okta
+ * * `Auth0` - Auth0
+ * * `Productboard` - Productboard
+ * * `Smartsheet` - Smartsheet
+ * * `Wrike` - Wrike
+ * * `Plaid` - Plaid
+ * * `SurveyMonkey` - SurveyMonkey
+ * * `Eventbrite` - Eventbrite
+ * * `RingCentral` - RingCentral
+ * * `Twilio` - Twilio
+ * * `Freshsales` - Freshsales
+ * * `Shortcut` - Shortcut
+ * * `ConvertKit` - ConvertKit
+ * * `Drip` - Drip
+ * * `CampaignMonitor` - CampaignMonitor
+ * * `MailerLite` - MailerLite
+ * * `Omnisend` - Omnisend
+ * * `Brevo` - Brevo
+ * * `Postmark` - Postmark
+ * * `Granola` - Granola
+ * * `BuildBetter` - BuildBetter
+ * * `Convex` - Convex
+ * * `ClickHouse` - ClickHouse
+ * * `Plain` - Plain
+ * * `Resend` - Resend
+ * * `PgAnalyze` - PgAnalyze
+ * * `WorkOS` - WorkOS
+ * * `AmazonS3` - AmazonS3
+ * * `GoogleCloudStorage` - GoogleCloudStorage
+ * * `Databricks` - Databricks
+ * * `Dynamics365` - Dynamics365
+ * * `SalesforceMarketingCloud` - SalesforceMarketingCloud
+ * * `Db2` - Db2
+ * * `Heap` - Heap
+ * * `AdobeAnalytics` - AdobeAnalytics
+ * * `Matomo` - Matomo
+ * * `Optimizely` - Optimizely
+ * * `Adyen` - Adyen
+ * * `GoCardless` - GoCardless
+ * * `Mollie` - Mollie
+ * * `CheckoutCom` - CheckoutCom
+ * * `Branch` - Branch
+ * * `Criteo` - Criteo
+ * * `Outbrain` - Outbrain
+ * * `Taboola` - Taboola
+ * * `AdRoll` - AdRoll
+ * * `DisplayVideo360` - DisplayVideo360
+ * * `GoogleAdManager` - GoogleAdManager
+ * * `CampaignManager360` - CampaignManager360
+ * * `SearchAds360` - SearchAds360
+ * * `AdobeCommerce` - AdobeCommerce
+ * * `AmazonSellingPartner` - AmazonSellingPartner
+ * * `Ebay` - Ebay
+ * * `Commercetools` - Commercetools
+ * * `LightspeedRetail` - LightspeedRetail
+ * * `ShipStation` - ShipStation
+ * * `ConstantContact` - ConstantContact
+ * * `Mailgun` - Mailgun
+ * * `Eloqua` - Eloqua
+ * * `Sailthru` - Sailthru
+ * * `Ortto` - Ortto
+ * * `Attentive` - Attentive
+ * * `Kustomer` - Kustomer
+ * * `Dixa` - Dixa
+ * * `Gladly` - Gladly
+ * * `Qualtrics` - Qualtrics
+ * * `Delighted` - Delighted
+ * * `AzureDevOps` - AzureDevOps
+ * * `Rollbar` - Rollbar
+ * * `Opsgenie` - Opsgenie
+ * * `IncidentIo` - IncidentIo
+ * * `Pingdom` - Pingdom
+ * * `Cloudflare` - Cloudflare
+ * * `CosmosDB` - CosmosDB
+ * * `PlanetScale` - PlanetScale
+ * * `SapHana` - SapHana
+ * * `Rippling` - Rippling
+ * * `HiBob` - HiBob
+ * * `Personio` - Personio
+ * * `Deel` - Deel
+ * * `AdpWorkforceNow` - AdpWorkforceNow
+ * * `Paylocity` - Paylocity
+ * * `Gusto` - Gusto
+ * * `CultureAmp` - CultureAmp
+ * * `Lattice` - Lattice
+ * * `SageIntacct` - SageIntacct
+ * * `FreshBooks` - FreshBooks
+ * * `Expensify` - Expensify
+ * * `Ramp` - Ramp
+ * * `Brex` - Brex
+ * * `Coupa` - Coupa
+ * * `SapConcur` - SapConcur
+ * * `Apollo` - Apollo
+ * * `Crunchbase` - Crunchbase
+ * * `ZoomInfo` - ZoomInfo
+ * * `Clari` - Clari
+ * * `Chorus` - Chorus
+ * * `Coda` - Coda
+ * * `Guru` - Guru
+ * * `Dropbox` - Dropbox
+ * * `Docusign` - Docusign
+ * * `PandaDoc` - PandaDoc
+ * * `SapErp` - SapErp
+ * * `SapSuccessFactors` - SapSuccessFactors
+ * * `OracleEbs` - OracleEbs
+ * * `OracleFusion` - OracleFusion
+ * * `AmazonSNS` - AmazonSNS
+ * * `AmazonEventBridge` - AmazonEventBridge
+ * * `AmazonSQS` - AmazonSQS
+ * * `AmazonKinesis` - AmazonKinesis
+ * * `AmazonCloudWatch` - AmazonCloudWatch
+ * * `OpenAIAds` - OpenAIAds
+ * * `OneHundredMs` - OneHundredMs
+ * * `SevenShifts` - SevenShifts
+ * * `AcuityScheduling` - AcuityScheduling
+ * * `AgileCRM` - AgileCRM
+ * * `Aha` - Aha
+ * * `Airbyte` - Airbyte
+ * * `Akeneo` - Akeneo
+ * * `Algolia` - Algolia
+ * * `AlpacaBrokerAPI` - AlpacaBrokerAPI
+ * * `ApifyDataset` - ApifyDataset
+ * * `Appcues` - Appcues
+ * * `Appfigures` - Appfigures
+ * * `Appfollow` - Appfollow
+ * * `Apptivo` - Apptivo
+ * * `AssemblyAI` - AssemblyAI
+ * * `Awin` - Awin
+ * * `AwsCloudTrail` - AwsCloudTrail
+ * * `AzureTableStorage` - AzureTableStorage
+ * * `Babelforce` - Babelforce
+ * * `Basecamp` - Basecamp
+ * * `Beamer` - Beamer
+ * * `BigMailer` - BigMailer
+ * * `Bluetally` - Bluetally
+ * * `BoldSign` - BoldSign
+ * * `BreezyHR` - BreezyHR
+ * * `Bugsnag` - Bugsnag
+ * * `Buildkite` - Buildkite
+ * * `Bunny` - Bunny
+ * * `Buzzsprout` - Buzzsprout
+ * * `CalCom` - CalCom
+ * * `CallRail` - CallRail
+ * * `Campayn` - Campayn
+ * * `Canny` - Canny
+ * * `CapsuleCRM` - CapsuleCRM
+ * * `CaptainData` - CaptainData
+ * * `CartCom` - CartCom
+ * * `CastorEDC` - CastorEDC
+ * * `Chameleon` - Chameleon
+ * * `Chargedesk` - Chargedesk
+ * * `Chargify` - Chargify
+ * * `Chift` - Chift
+ * * `Churnkey` - Churnkey
+ * * `Cin7` - Cin7
+ * * `CiscoMeraki` - CiscoMeraki
+ * * `Clazar` - Clazar
+ * * `Clockify` - Clockify
+ * * `Clockodo` - Clockodo
+ * * `Cloudbeds` - Cloudbeds
+ * * `Coassemble` - Coassemble
+ * * `Codefresh` - Codefresh
+ * * `Concord` - Concord
+ * * `ConfigCat` - ConfigCat
+ * * `Couchbase` - Couchbase
+ * * `Curve` - Curve
+ * * `Customerly` - Customerly
+ * * `Datascope` - Datascope
+ * * `Dbt` - Dbt
+ * * `Deputy` - Deputy
+ * * `DevinAI` - DevinAI
+ * * `Docuseal` - Docuseal
+ * * `Dolibarr` - Dolibarr
+ * * `Dremio` - Dremio
+ * * `DropboxSign` - DropboxSign
+ * * `Dwolla` - Dwolla
+ * * `EConomic` - EConomic
+ * * `Easypost` - Easypost
+ * * `Easypromos` - Easypromos
+ * * `Elasticemail` - Elasticemail
+ * * `EmailOctopus` - EmailOctopus
+ * * `EmploymentHero` - EmploymentHero
+ * * `Encharge` - Encharge
+ * * `Eventee` - Eventee
+ * * `Eventzilla` - Eventzilla
+ * * `Everhour` - Everhour
+ * * `EZOfficeInventory` - EZOfficeInventory
+ * * `Factorial` - Factorial
+ * * `Fastbill` - Fastbill
+ * * `Fastly` - Fastly
+ * * `Fauna` - Fauna
+ * * `Feishu` - Feishu
+ * * `Fillout` - Fillout
+ * * `Finage` - Finage
+ * * `Firebolt` - Firebolt
+ * * `FireHydrant` - FireHydrant
+ * * `Fleetio` - Fleetio
+ * * `Flexmail` - Flexmail
+ * * `Flexport` - Flexport
+ * * `FloatApp` - FloatApp
+ * * `Flowlu` - Flowlu
+ * * `Formbricks` - Formbricks
+ * * `FreeAgent` - FreeAgent
+ * * `Freightview` - Freightview
+ * * `Freshcaller` - Freshcaller
+ * * `Freshchat` - Freshchat
+ * * `Freshservice` - Freshservice
+ * * `Fulcrum` - Fulcrum
+ * * `GainsightPx` - GainsightPx
+ * * `GitBook` - GitBook
+ * * `Glassfrog` - Glassfrog
+ * * `Goldcast` - Goldcast
+ * * `GoLogin` - GoLogin
+ * * `Grafana` - Grafana
+ * * `GreytHr` - GreytHr
+ * * `Gridly` - Gridly
+ * * `Harness` - Harness
+ * * `Height` - Height
+ * * `Hellobaton` - Hellobaton
+ * * `HighLevel` - HighLevel
+ * * `HoorayHR` - HoorayHR
+ * * `Hubplanner` - Hubplanner
+ * * `Humanitix` - Humanitix
+ * * `Huntr` - Huntr
+ * * `Inflowinventory` - Inflowinventory
+ * * `InforNexus` - InforNexus
+ * * `Insightful` - Insightful
+ * * `Insightly` - Insightly
+ * * `Instatus` - Instatus
+ * * `Intruder` - Intruder
+ * * `Invoiced` - Invoiced
+ * * `Invoiceninja` - Invoiceninja
+ * * `JamfPro` - JamfPro
+ * * `JobNimbus` - JobNimbus
+ * * `Jotform` - Jotform
+ * * `JudgeMeReviews` - JudgeMeReviews
+ * * `JustCall` - JustCall
+ * * `JustSift` - JustSift
+ * * `K6Cloud` - K6Cloud
+ * * `Katana` - Katana
+ * * `Keka` - Keka
+ * * `Kisi` - Kisi
+ * * `Kissmetrics` - Kissmetrics
+ * * `Klarna` - Klarna
+ * * `Klaus` - Klaus
+ * * `Lago` - Lago
+ * * `Leadfeeder` - Leadfeeder
+ * * `Lemlist` - Lemlist
+ * * `LessAnnoyingCRM` - LessAnnoyingCRM
+ * * `LinkedinPages` - LinkedinPages
+ * * `Linkrunner` - Linkrunner
+ * * `Linnworks` - Linnworks
+ * * `Lob` - Lob
+ * * `Lokalise` - Lokalise
+ * * `Looker` - Looker
+ * * `Luma` - Luma
+ * * `MailerSend` - MailerSend
+ * * `Mailosaur` - Mailosaur
+ * * `Mailtrap` - Mailtrap
+ * * `Mantle` - Mantle
+ * * `Mention` - Mention
+ * * `MercadoAds` - MercadoAds
+ * * `Merge` - Merge
+ * * `Metabase` - Metabase
+ * * `Metricool` - Metricool
+ * * `MicrosoftDataverse` - MicrosoftDataverse
+ * * `MicrosoftEntraId` - MicrosoftEntraId
+ * * `MicrosoftLists` - MicrosoftLists
+ * * `Miro` - Miro
+ * * `Missive` - Missive
+ * * `MixMax` - MixMax
+ * * `Mode` - Mode
+ * * `Mux` - Mux
+ * * `MyHours` - MyHours
+ * * `N8n` - N8n
+ * * `Navan` - Navan
+ * * `NebiusAI` - NebiusAI
+ * * `Nexiopay` - Nexiopay
+ * * `NinjaOneRMM` - NinjaOneRMM
+ * * `NoCRM` - NoCRM
+ * * `NorthpassLMS` - NorthpassLMS
+ * * `Nutshell` - Nutshell
+ * * `Nylas` - Nylas
+ * * `Oncehub` - Oncehub
+ * * `Onepagecrm` - Onepagecrm
+ * * `OneSignal` - OneSignal
+ * * `Onfleet` - Onfleet
+ * * `OpinionStage` - OpinionStage
+ * * `OPUSWatch` - OPUSWatch
+ * * `Orb` - Orb
+ * * `Orbit` - Orbit
+ * * `Oura` - Oura
+ * * `Oveit` - Oveit
+ * * `PabblySubscriptionsBilling` - PabblySubscriptionsBilling
+ * * `Paperform` - Paperform
+ * * `Papersign` - Papersign
+ * * `Partnerize` - Partnerize
+ * * `PartnerStack` - PartnerStack
+ * * `PayFit` - PayFit
+ * * `Paystack` - Paystack
+ * * `Pennylane` - Pennylane
+ * * `Perk` - Perk
+ * * `PersistIq` - PersistIq
+ * * `Persona` - Persona
+ * * `Phyllo` - Phyllo
+ * * `Picqer` - Picqer
+ * * `Pipeliner` - Pipeliner
+ * * `PivotalTracker` - PivotalTracker
+ * * `Piwik` - Piwik
+ * * `Planhat` - Planhat
+ * * `Plausible` - Plausible
+ * * `Poplar` - Poplar
+ * * `PrestaShop` - PrestaShop
+ * * `Pretix` - Pretix
+ * * `Primetric` - Primetric
+ * * `Printify` - Printify
+ * * `Productive` - Productive
+ * * `Pylon` - Pylon
+ * * `Qonto` - Qonto
+ * * `Qualaroo` - Qualaroo
+ * * `Railz` - Railz
+ * * `RDStationMarketing` - RDStationMarketing
+ * * `Recruitee` - Recruitee
+ * * `Reddit` - Reddit
+ * * `ReferralHero` - ReferralHero
+ * * `RentCast` - RentCast
+ * * `Repairshopr` - Repairshopr
+ * * `ReplyIo` - ReplyIo
+ * * `RetailExpress` - RetailExpress
+ * * `Retently` - Retently
+ * * `RevolutMerchant` - RevolutMerchant
+ * * `RocketChat` - RocketChat
+ * * `Rocketlane` - Rocketlane
+ * * `Rootly` - Rootly
+ * * `Ruddr` - Ruddr
+ * * `SafetyCulture` - SafetyCulture
+ * * `SageHR` - SageHR
+ * * `Salesflare` - Salesflare
+ * * `SAPFieldglass` - SAPFieldglass
+ * * `SavvyCal` - SavvyCal
+ * * `Secoda` - Secoda
+ * * `Segment` - Segment
+ * * `Sendowl` - Sendowl
+ * * `SendPulse` - SendPulse
+ * * `Senseforce` - Senseforce
+ * * `Serpstat` - Serpstat
+ * * `Sharetribe` - Sharetribe
+ * * `Shippo` - Shippo
+ * * `ShopWired` - ShopWired
+ * * `Shortio` - Shortio
+ * * `Shutterstock` - Shutterstock
+ * * `SigmaComputing` - SigmaComputing
+ * * `SignNow` - SignNow
+ * * `SimpleCast` - SimpleCast
+ * * `Simplesat` - Simplesat
+ * * `Smaily` - Smaily
+ * * `SmartEngage` - SmartEngage
+ * * `Smartreach` - Smartreach
+ * * `Smartwaiver` - Smartwaiver
+ * * `SolarwindsServiceDesk` - SolarwindsServiceDesk
+ * * `SonarCloud` - SonarCloud
+ * * `SparkPost` - SparkPost
+ * * `SplitIo` - SplitIo
+ * * `SpotifyAds` - SpotifyAds
+ * * `SpotlerCRM` - SpotlerCRM
+ * * `Squarespace` - Squarespace
+ * * `Statsig` - Statsig
+ * * `Statuspage` - Statuspage
+ * * `Stigg` - Stigg
+ * * `Strava` - Strava
+ * * `SurveySparrow` - SurveySparrow
+ * * `Survicate` - Survicate
+ * * `Svix` - Svix
+ * * `Systeme` - Systeme
+ * * `Tavus` - Tavus
+ * * `Teamtailor` - Teamtailor
+ * * `Teamwork` - Teamwork
+ * * `Tempo` - Tempo
+ * * `Testrail` - Testrail
+ * * `Thinkific` - Thinkific
+ * * `ThinkificCourses` - ThinkificCourses
+ * * `ThriveLearning` - ThriveLearning
+ * * `Ticketmaster` - Ticketmaster
+ * * `TicketTailor` - TicketTailor
+ * * `TickTick` - TickTick
+ * * `Timely` - Timely
+ * * `Tinyemail` - Tinyemail
+ * * `Todoist` - Todoist
+ * * `Toggl` - Toggl
+ * * `TrackPMS` - TrackPMS
+ * * `Tremendous` - Tremendous
+ * * `TrustPilot` - TrustPilot
+ * * `Twitter` - Twitter
+ * * `TyntecSMS` - TyntecSMS
+ * * `Unleash` - Unleash
+ * * `UpPromote` - UpPromote
+ * * `Uptick` - Uptick
+ * * `Uservoice` - Uservoice
+ * * `Vantage` - Vantage
+ * * `Veeqo` - Veeqo
+ * * `Vercel` - Vercel
+ * * `VismaEconomic` - VismaEconomic
+ * * `VWO` - VWO
+ * * `Waiteraid` - Waiteraid
+ * * `Wasabi` - Wasabi
+ * * `WhenIWork` - WhenIWork
+ * * `Wordpress` - Wordpress
+ * * `Workable` - Workable
+ * * `Workflowmax` - Workflowmax
+ * * `Workramp` - Workramp
+ * * `Wufoo` - Wufoo
+ * * `Xsolla` - Xsolla
+ * * `YandexMetrica` - YandexMetrica
+ * * `Yotpo` - Yotpo
+ * * `Ynab` - Ynab
+ * * `Younium` - Younium
+ * * `YouSign` - YouSign
+ * * `YoutubeData` - YoutubeData
+ * * `ZapierSupportedStorage` - ZapierSupportedStorage
+ * * `ZapSign` - ZapSign
+ * * `ZendeskSell` - ZendeskSell
+ * * `ZendeskSunshine` - ZendeskSunshine
+ * * `Zenefits` - Zenefits
+ * * `Zenloop` - Zenloop
+ * * `ZohoAnalytics` - ZohoAnalytics
+ * * `ZohoBigin` - ZohoBigin
+ * * `ZohoBilling` - ZohoBilling
+ * * `ZohoBooks` - ZohoBooks
+ * * `ZohoCampaign` - ZohoCampaign
+ * * `ZohoDesk` - ZohoDesk
+ * * `ZohoExpense` - ZohoExpense
+ * * `ZohoInventory` - ZohoInventory
+ * * `ZohoInvoice` - ZohoInvoice
+ * * `ZonkaFeedback` - ZonkaFeedback
+ * * `AlphaVantage` - AlphaVantage
+ * * `Aviationstack` - Aviationstack
+ * * `Bitly` - Bitly
+ * * `Blogger` - Blogger
+ * * `Breezometer` - Breezometer
+ * * `CareQualityCommission` - CareQualityCommission
+ * * `Cimis` - Cimis
+ * * `CoinApi` - CoinApi
+ * * `CoinGecko` - CoinGecko
+ * * `CoinMarketCap` - CoinMarketCap
+ * * `DingConnect` - DingConnect
+ * * `Dockerhub` - Dockerhub
+ * * `ExchangeRatesApi` - ExchangeRatesApi
+ * * `FinancialModelling` - FinancialModelling
+ * * `Finnhub` - Finnhub
+ * * `Finnworlds` - Finnworlds
+ * * `Giphy` - Giphy
+ * * `Gmail` - Gmail
+ * * `GNews` - GNews
+ * * `GoogleCalendar` - GoogleCalendar
+ * * `GoogleClassroom` - GoogleClassroom
+ * * `GoogleDirectory` - GoogleDirectory
+ * * `GoogleForms` - GoogleForms
+ * * `GooglePageSpeedInsights` - GooglePageSpeedInsights
+ * * `GoogleTasks` - GoogleTasks
+ * * `GoogleWebfonts` - GoogleWebfonts
+ * * `GoogleWorkspaceAdminReports` - GoogleWorkspaceAdminReports
+ * * `HuggingFace` - HuggingFace
+ * * `IlluminaBasespace` - IlluminaBasespace
+ * * `Imagga` - Imagga
+ * * `Interzoid` - Interzoid
+ * * `IP2Whois` - IP2Whois
+ * * `KYVE` - KYVE
+ * * `Marketstack` - Marketstack
+ * * `Mendeley` - Mendeley
+ * * `Nasa` - Nasa
+ * * `NewYorkTimes` - NewYorkTimes
+ * * `NewsApi` - NewsApi
+ * * `NewsData` - NewsData
+ * * `OpenDataDc` - OpenDataDc
+ * * `OpenExchangeRates` - OpenExchangeRates
+ * * `OpenAQ` - OpenAQ
+ * * `OpenFDA` - OpenFDA
+ * * `OpenWeather` - OpenWeather
+ * * `Outlook` - Outlook
+ * * `Perigon` - Perigon
+ * * `Pexels` - Pexels
+ * * `Pocket` - Pocket
+ * * `Polygon` - Polygon
+ * * `PyPI` - PyPI
+ * * `Recreation` - Recreation
+ * * `RKICovid` - RKICovid
+ * * `Rss` - Rss
+ * * `SimFin` - SimFin
+ * * `StockData` - StockData
+ * * `Guardian` - Guardian
+ * * `TMDb` - TMDb
+ * * `TVMaze` - TVMaze
+ * * `TwelveData` - TwelveData
+ * * `Ubidots` - Ubidots
+ * * `USCensus` - USCensus
+ * * `Watchmode` - Watchmode
+ * * `WikipediaPageviews` - WikipediaPageviews
+ * * `YahooFinance` - YahooFinance
+ * * `Clarifai` - Clarifai
+ * * `Adapty` - Adapty
+ * * `Braintrust` - Braintrust
+ * * `StreamElements` - StreamElements
+ * * `Streamlabs` - Streamlabs
+ * * `Datorama` - Datorama
+ * * `Ahrefs` - Ahrefs
+ * * `Lightfield` - Lightfield
+ * * `Appstack` - Appstack
+ * * `Razorpay` - Razorpay
+ * * `Neon` - Neon
+ * * `NewRelic` - NewRelic
+ * * `Custom` - Custom
+ * * `Tile38` - Tile38
+ * * `Chatwoot` - Chatwoot
+ * * `Sanity` - Sanity
+ * * `Metronome` - Metronome
+ * * `Jobber` - Jobber
+ * * `Knock` - Knock
+ * * `Leexi` - Leexi
+ * * `RB2B` - RB2B
+ * * `Superwall` - Superwall */
+ source_type: ExternalDataSourceTypeEnum;
+ /** Source config as flat keys. For source_type 'Custom': 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the manifest's declared auth type — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic). Secrets stay in these auth_* keys, never inline in the manifest. */
+ payload?: SourcePreviewRequestPayload;
+ /** Which manifest resource (table) to read a sample from — one of the resource names in manifest_json. */
+ resource_name: string;
+ /**
+ * Maximum sample rows to return (1–50). Defaults to 10.
+ * @minimum 1
+ * @maximum 50
+ */
+ limit?: number;
+ }
+
+ export type SourcePreviewResponseRowsItem = { [key: string]: unknown };
+
+ export interface SourcePreviewResponse {
+ /** Up to `limit` sample rows, after data_selector extraction — the raw records the sync would ingest. */
+ rows: SourcePreviewResponseRowsItem[];
+ /** Number of sample rows returned (≤ limit). */
+ row_count: number;
+ /** Columns observed across the sample rows, each with an inferred JSON type. */
+ columns: SourcePreviewColumn[];
+ /**
+ * Set when the live read failed (e.g. the host was unreachable or returned an auth error); rows is then empty. Manifest, validation, and SSRF problems return HTTP 400 instead of populating this field.
+ * @nullable
+ */
+ error: string | null;
+ }
+
/**
* Connection details as flat keys for the source_type (discover required fields with the wizard tool). Prefer references over raw secrets: pass {'credential_id': <id>} referencing the connection details the user stored via the connect-link page (discover ids with the stored_credentials endpoint) — they are merged in server-side and deleted once consumed. An already-connected OAuth integration can be passed via its id key instead (e.g. {'hubspot_integration_id': 123}). For source_type 'Custom' (a user-defined REST API) the keys are 'manifest_json' (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the auth type the manifest declares — 'auth_token' (bearer), 'auth_api_key' (api_key), or 'auth_password' (http_basic); keep secrets in these auth_* keys, never inline in the manifest. A 'schemas' array is NOT required — all discovered tables are enabled automatically with sensible sync defaults.
*/
diff --git a/services/mcp/src/tools/index.ts b/services/mcp/src/tools/index.ts
index 59faaa917e11..1c10dc35d5f4 100644
--- a/services/mcp/src/tools/index.ts
+++ b/services/mcp/src/tools/index.ts
@@ -26,6 +26,7 @@ import {
executeSql,
externalDataSourcesDbSchema,
externalDataSourcesJobs,
+ externalDataSourcesPreview,
externalDataSyncLogs,
readDataSchema,
readDataWarehouseSchema,
@@ -98,6 +99,7 @@ export const TOOL_MAP: Record<string, () => ToolBase<ZodObjectAny>> = {
// Data warehouse (custom handlers for non-standard request shapes)
'external-data-sources-db-schema': externalDataSourcesDbSchema,
+ 'external-data-sources-preview-resource': externalDataSourcesPreview,
'external-data-sources-jobs': externalDataSourcesJobs,
'external-data-sync-logs': externalDataSyncLogs,
diff --git a/services/mcp/src/tools/posthogAiTools/externalDataSourcesPreview.ts b/services/mcp/src/tools/posthogAiTools/externalDataSourcesPreview.ts
new file mode 100644
index 000000000000..a06b654aae32
--- /dev/null
+++ b/services/mcp/src/tools/posthogAiTools/externalDataSourcesPreview.ts
@@ -0,0 +1,51 @@
+import { z } from 'zod'
+
+import { ExternalDataSourcePayloadSchema, ExternalDataSourceTypeSchema } from '@/schema/tool-inputs'
+import type { Context, ToolBase } from '@/tools/types'
+
+// Mirrors PREVIEW_MAX_ROWS / PREVIEW_DEFAULT_ROWS in posthog/temporal/data_imports/sources/custom/source.py.
+// The backend serializer enforces both regardless; naming them here keeps the two sides greppable together.
+const PREVIEW_MAX_ROWS = 50
+const PREVIEW_DEFAULT_ROWS = 10
+
+const schema = z.object({
+ source_type: ExternalDataSourceTypeSchema,
+ payload: ExternalDataSourcePayloadSchema,
+ resource_name: z
+ .string()
+ .describe(
+ 'Which manifest resource (table) to read a sample from — one of the resource names in manifest_json.'
+ ),
+ limit: z
+ .number()
+ .int()
+ .min(1)
+ .max(PREVIEW_MAX_ROWS)
+ .optional()
+ .describe(`Maximum sample rows to return (1–${PREVIEW_MAX_ROWS}). Defaults to ${PREVIEW_DEFAULT_ROWS}.`),
+})
+
+type Params = z.infer<typeof schema>
+
+const tool = (): ToolBase<typeof schema, unknown> => ({
+ name: 'external-data-sources-preview-resource',
+ schema,
+ handler: async (context: Context, params: Params) => {
+ const projectId = await context.stateManager.getProjectId()
+ // The preview endpoint nests credentials under `payload` (unlike db-schema's flat body),
+ // so forward the payload object untouched rather than spreading it.
+ const result = await context.api.request<unknown>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/external_data_sources/preview_resource/`,
+ body: {
+ source_type: params.source_type,
+ payload: params.payload,
+ resource_name: params.resource_name,
+ limit: params.limit,
+ },
+ })
+ return result
+ },
+})
+
+export default tool
diff --git a/services/mcp/src/tools/posthogAiTools/index.ts b/services/mcp/src/tools/posthogAiTools/index.ts
index d3f098dd45ad..aa7ec1bf9820 100644
--- a/services/mcp/src/tools/posthogAiTools/index.ts
+++ b/services/mcp/src/tools/posthogAiTools/index.ts
@@ -1,6 +1,7 @@
export { default as executeSql } from './executeSql'
export { default as externalDataSourcesDbSchema } from './externalDataSourcesDbSchema'
export { default as externalDataSourcesJobs } from './externalDataSourcesJobs'
+export { default as externalDataSourcesPreview } from './externalDataSourcesPreview'
export { default as externalDataSyncLogs } from './externalDataSyncLogs'
export { default as readDataSchema } from './readDataSchema'
export { default as readDataWarehouseSchema } from './readDataWarehouseSchema'
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-preview-resource.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-preview-resource.json
new file mode 100644
index 000000000000..333a02a0ee1c
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-preview-resource.json
@@ -0,0 +1,29 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "limit": {
+ "description": "Maximum sample rows to return (1–50). Defaults to 10.",
+ "maximum": 50,
+ "minimum": 1,
+ "type": "integer"
+ },
+ "payload": {
+ "additionalProperties": {},
+ "description": "Connection credentials for the source. Keys depend on source_type. For database sources: host, port, database, user, password, schema. For SaaS sources: api_key or OAuth fields. For source_type \"Custom\" (a user-defined REST API): `manifest_json` (a stringified RESTAPIConfig describing client.base_url, auth, and resources) plus the credential for the auth type declared in the manifest — `auth_token` (bearer), `auth_api_key` (api_key), or `auth_password` (http_basic); keep secrets in these auth_* keys, never inline in manifest_json. Use external-data-sources-wizard to see required fields per source type.",
+ "propertyNames": {
+ "type": "string"
+ },
+ "type": "object"
+ },
+ "resource_name": {
+ "description": "Which manifest resource (table) to read a sample from — one of the resource names in manifest_json.",
+ "type": "string"
+ },
+ "source_type": {
+ "description": "The source type name (e.g. \"Postgres\", \"MySQL\", \"Stripe\"). Use external-data-sources-wizard to see available types and their required fields.",
+ "type": "string"
+ }
+ },
+ "required": ["source_type", "payload", "resource_name"],
+ "type": "object"
+}
diff --git a/services/mcp/tests/unit/custom-tool-handlers.test.ts b/services/mcp/tests/unit/custom-tool-handlers.test.ts
index 8a84f93599c6..35c02d57f00f 100644
--- a/services/mcp/tests/unit/custom-tool-handlers.test.ts
+++ b/services/mcp/tests/unit/custom-tool-handlers.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it, vi } from 'vitest'
import externalDataSourcesDbSchema from '@/tools/posthogAiTools/externalDataSourcesDbSchema'
import externalDataSourcesJobs from '@/tools/posthogAiTools/externalDataSourcesJobs'
+import externalDataSourcesPreview from '@/tools/posthogAiTools/externalDataSourcesPreview'
import type { Context } from '@/tools/types'
function createMockContext(requestMock: ReturnType<typeof vi.fn>): Context {
@@ -66,6 +67,48 @@ describe('externalDataSourcesDbSchema', () => {
})
})
+describe('externalDataSourcesPreview', () => {
+ it('posts a nested payload alongside source_type, resource_name and limit', async () => {
+ const requestMock = vi.fn().mockResolvedValue({ rows: [], row_count: 0, columns: [], error: null })
+ const context = createMockContext(requestMock)
+ const tool = externalDataSourcesPreview()
+
+ await tool.handler(context, {
+ source_type: 'Custom',
+ payload: { manifest_json: '{"client":{}}', auth_api_key: 'sk_test' },
+ resource_name: 'users',
+ limit: 5,
+ })
+
+ expect(requestMock).toHaveBeenCalledWith({
+ method: 'POST',
+ path: '/api/projects/42/external_data_sources/preview_resource/',
+ body: {
+ source_type: 'Custom',
+ payload: { manifest_json: '{"client":{}}', auth_api_key: 'sk_test' },
+ resource_name: 'users',
+ limit: 5,
+ },
+ })
+ })
+
+ it('keeps credentials nested inside payload, not at the top level', async () => {
+ const requestMock = vi.fn().mockResolvedValue({})
+ const context = createMockContext(requestMock)
+ const tool = externalDataSourcesPreview()
+
+ await tool.handler(context, {
+ source_type: 'Custom',
+ payload: { manifest_json: '{}', auth_token: 'secret' },
+ resource_name: 'users',
+ })
+
+ const body = requestMock.mock.calls[0]![0].body
+ expect(body).not.toHaveProperty('auth_token')
+ expect(body.payload.auth_token).toBe('secret')
+ })
+})
+
describe('externalDataSourcesJobs', () => {
it('passes all query params as repeated keys when provided', async () => {
const requestMock = vi.fn().mockResolvedValue([])