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(data-warehouse): add heygen lipsyncs and audio voices tables (#121102)

Tom Owers5b15fec85936
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
index 258302df4d9b..1f39aae9d848 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
@@ -5899,7 +5899,7 @@ Today (8): `account`, `avatar_groups`, `avatar_looks`, `templates`, `video_agent
Diffed against: <https://developers.heygen.com/openapi/external-api.json>
-- [ ] `Lipsyncs (GET /v3/lipsyncs)` — track dubbing jobs, completion status, failures, and output duration alongside generated videos (high)
+- [x] `Lipsyncs (GET /v3/lipsyncs)` — track dubbing jobs, completion status, failures, and output duration alongside generated videos (high)
- [ ] `Workflow runs (GET /v3/workflow-runs)` — measure automated video workflows by run status, creation time, and failure rate (medium)
- [ ] `Workflow run nodes (GET /v3/workflow-runs/{run_id}/nodes)` — identify slow or failed workflow steps from node status and timestamps (medium)
- [ ] `AI Clipping (GET /v3/ai-clipping)` — analyze clipping job outcomes and the clips produced from each source video (medium)
@@ -5907,7 +5907,7 @@ Diffed against: <https://developers.heygen.com/openapi/external-api.json>
- [ ] `Proofread sessions (GET /v3/video-translations/proofreads)` — track subtitle review status before translated videos reach final generation (medium)
- [ ] `Podcasts (GET /v3/podcasts)` — analyze podcast generation outcomes and output across the workspace (medium)
- [ ] `Background removals (GET /v3/background-removals)` — measure background removal job volume, outcomes, and failures (medium)
-- [ ] `Audio voices (GET /v3/models/audio/voices)` — inventory professional and instant voice clones with their training status and creation dates (medium)
+- [x] `Audio voices (GET /v3/models/audio/voices)` — inventory professional and instant voice clones with their training status and creation dates (medium)
Note: Parsed every GET operation in the official external API specification and compared paths with the v3 catalog. Avatar and voice tables currently select private resources. Workflow runs require workflow IDs from GET /v3/workflows, and node history needs run fan-out. Uploads and webhook configuration are excluded.
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/canonical_descriptions.py
index 391628ddf7db..e07a3cfc80f4 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/canonical_descriptions.py
@@ -73,6 +73,33 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"aspect_ratio": "Aspect ratio of the template output.",
},
},
+ "lipsyncs": {
+ "description": "Lipsync jobs that replace or dub the audio of an existing video.",
+ "docs_url": "https://developers.heygen.com/reference/list-lipsyncs",
+ "columns": {
+ "id": "Unique lipsync identifier.",
+ "title": "Title of the lipsync job.",
+ "status": "Job status: pending, running, completed, or failed.",
+ "duration": "Output video duration in seconds.",
+ "created_at": "Lipsync creation time in Unix seconds.",
+ "failure_message": "Error description. Present only when the status is failed.",
+ "callback_id": "Client-provided callback identifier.",
+ },
+ },
+ "audio_voices": {
+ "description": "Professional and instant voice clones in the workspace, with their training status.",
+ "docs_url": "https://developers.heygen.com/reference/list-audio-voices",
+ "columns": {
+ "voice_id": "Unique voice identifier.",
+ "mode": "Clone type: professional or instant.",
+ "name": "Display name of the voice.",
+ "language": "Primary language code of the voice.",
+ "status": "Training status: PENDING, ACTIVE, or FAILED.",
+ "created_at": "Voice creation time in Unix seconds.",
+ "failure_reason": "Failure code. Present only when the status is FAILED.",
+ "preview_audio_url": "Expiring URL for an audio sample of the voice.",
+ },
+ },
"account": {
"description": "Current account profile and billing balance, including wallet or subscription credits.",
"docs_url": "https://developers.heygen.com/reference/get-current-user",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/settings.py
index 40e6addab413..a9c90a634835 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/settings.py
@@ -36,6 +36,14 @@ ENDPOINTS: dict[str, HeyGenEndpoint] = {
path="voices", primary_key="voice_id", partition_key=None, params={"type": "private"}, scope="voices:read"
),
"templates": HeyGenEndpoint(path="templates", scope="templates:read"),
+ "lipsyncs": HeyGenEndpoint(path="lipsyncs", scope="lipsync:read"),
+ "audio_voices": HeyGenEndpoint(
+ path="models/audio/voices",
+ primary_key="voice_id",
+ sort_mode="desc",
+ params={"type": "private"},
+ scope="voices:read",
+ ),
"account": HeyGenEndpoint(
path="users/me", primary_key="username", partition_key=None, paginated=False, scope="account:read"
),
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/source.py
index 5a3eba629f4c..c90a747a5dbb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/source.py
@@ -57,7 +57,7 @@ class HeyGenSource(ResumableSource[HeyGenSourceConfig, HeyGenResumeConfig]):
caption=(
"Create an API key in [HeyGen settings](https://app.heygen.com/developers/api). "
"Grant read scopes for the tables you select: `videos:read`, `translations:read`, "
- "`video_agent:read`, `avatars:read`, `voices:read`, `templates:read`, and `account:read`. "
+ "`video_agent:read`, `lipsync:read`, `avatars:read`, `voices:read`, `templates:read`, and `account:read`. "
"Avatar and voice tables include your private resources."
),
iconPath="/static/services/heygen.png",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/tests/test_heygen.py b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/tests/test_heygen.py
index 55617d08baa0..1d9e0ebaa963 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/tests/test_heygen.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/heygen/tests/test_heygen.py
@@ -16,9 +16,20 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.heygen.hey
from products.warehouse_sources.backend.temporal.data_imports.sources.heygen.tests.utils import sync_items
[email protected]("terminal_token", [None, ""])
+ "terminal_token,endpoint,path,filters",
+ [
+ (None, "videos", "/v3/videos", {}),
+ ("", "videos", "/v3/videos", {}),
+ (None, "lipsyncs", "/v3/lipsyncs", {}),
+ (None, "audio_voices", "/v3/models/audio/voices", {"type": ["private"]}),
+ ],
+)
def test_cursor_pages_checkpoint_after_yield(
terminal_token: str | None,
+ endpoint: str,
+ path: str,
+ filters: dict[str, list[str]],
http: Mock,
response: Callable[..., Response],
manager: ResumableSourceManager[HeyGenResumeConfig],
@@ -28,7 +39,7 @@ def test_cursor_pages_checkpoint_after_yield(
response({"data": [{"id": "video-first"}], "has_more": True, "next_token": "opaque+/=token"}),
response({"data": [{"id": "video-last"}], "has_more": False, "next_token": terminal_token}),
]
- pages = iter(sync_items(heygen_source("fake-key", "videos", "v3", 1, "job-test", manager)))
+ pages = iter(sync_items(heygen_source("fake-key", endpoint, "v3", 1, "job-test", manager)))
assert next(pages) == [{"id": "video-first"}]
manager.confirm()
assert not manager.has_staged_state()
@@ -37,7 +48,9 @@ def test_cursor_pages_checkpoint_after_yield(
manager.commit()
saved = redis.set.call_args.args[1]
assert saved == '{"cursor":"opaque+/=token"}'
- assert parse_qs(urlsplit(http.call_args.args[0].url).query)["token"] == ["opaque+/=token"]
+ url = urlsplit(http.call_args.args[0].url)
+ assert url.path == path
+ assert parse_qs(url.query) == {"limit": ["100"], "token": ["opaque+/=token"], **filters}
assert list(pages) == []
redis.delete.assert_called_once()
assert http.call_count == 2