@utdk/posthog 1.0.0-20260712.5-dev.e2949a6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +172 -0
  3. package/docs/account_relationship_definitions.md +194 -0
  4. package/docs/accounts.md +380 -0
  5. package/docs/actions.md +274 -0
  6. package/docs/activity_logs.md +144 -0
  7. package/docs/advanced_activity_logs.md +101 -0
  8. package/docs/agent_platform.md +2525 -0
  9. package/docs/ai-observability.md +514 -0
  10. package/docs/alerts.md +444 -0
  11. package/docs/annotations.md +200 -0
  12. package/docs/batch_exports.md +2118 -0
  13. package/docs/business_knowledge.md +468 -0
  14. package/docs/code-invites.md +72 -0
  15. package/docs/cohorts.md +412 -0
  16. package/docs/comments.md +321 -0
  17. package/docs/conversations.md +695 -0
  18. package/docs/custom_property_definitions.md +442 -0
  19. package/docs/custom_property_sources.md +194 -0
  20. package/docs/customer_analytics.md +442 -0
  21. package/docs/customer_journeys.md +380 -0
  22. package/docs/customer_profile_configs.md +380 -0
  23. package/docs/dashboard_templates.md +258 -0
  24. package/docs/dashboards.md +1896 -0
  25. package/docs/data_color_themes.md +380 -0
  26. package/docs/data_modeling_jobs.md +264 -0
  27. package/docs/data_warehouse.md +928 -0
  28. package/docs/dataset_items.md +382 -0
  29. package/docs/datasets.md +382 -0
  30. package/docs/desktop_file_system.md +753 -0
  31. package/docs/desktop_file_system_shortcut.md +244 -0
  32. package/docs/docs.md +72 -0
  33. package/docs/early_access_feature.md +194 -0
  34. package/docs/elements.md +510 -0
  35. package/docs/endpoints.md +1030 -0
  36. package/docs/engineering_analytics.md +712 -0
  37. package/docs/environments.md +881 -0
  38. package/docs/error_tracking.md +5108 -0
  39. package/docs/evaluation_runs.md +78 -0
  40. package/docs/evaluations.md +446 -0
  41. package/docs/event_definitions.md +425 -0
  42. package/docs/event_filter.md +280 -0
  43. package/docs/event_schemas.md +163 -0
  44. package/docs/events.md +208 -0
  45. package/docs/experiment_holdouts.md +194 -0
  46. package/docs/experiment_saved_metrics.md +194 -0
  47. package/docs/experiments.md +1088 -0
  48. package/docs/exports.md +256 -0
  49. package/docs/external_data_schemas.md +752 -0
  50. package/docs/external_data_sources.md +2296 -0
  51. package/docs/feature_flags.md +808 -0
  52. package/docs/field_notes.md +206 -0
  53. package/docs/file_system.md +880 -0
  54. package/docs/file_system_shortcut.md +444 -0
  55. package/docs/flag_value.md +46 -0
  56. package/docs/groups.md +514 -0
  57. package/docs/groups_types.md +349 -0
  58. package/docs/health_issues.md +386 -0
  59. package/docs/heatmap_screenshots.md +72 -0
  60. package/docs/heatmaps.md +136 -0
  61. package/docs/hog_flows.md +1576 -0
  62. package/docs/hog_function_templates.md +101 -0
  63. package/docs/hog_functions.md +974 -0
  64. package/docs/ingestion_warnings_v2.md +40 -0
  65. package/docs/insight_variables.md +380 -0
  66. package/docs/insights.md +1722 -0
  67. package/docs/integrations.md +1954 -0
  68. package/docs/js-snippet.md +104 -0
  69. package/docs/live_debugger_breakpoints.md +264 -0
  70. package/docs/llm_analytics.md +3373 -0
  71. package/docs/llm_prompts.md +442 -0
  72. package/docs/llm_skills.md +952 -0
  73. package/docs/logs.md +2446 -0
  74. package/docs/managed_viewsets.md +140 -0
  75. package/docs/marketing_analytics.md +518 -0
  76. package/docs/max.md +772 -0
  77. package/docs/max_tools.md +70 -0
  78. package/docs/mcp_analytics.md +712 -0
  79. package/docs/mcp_server_installations.md +970 -0
  80. package/docs/mcp_servers.md +78 -0
  81. package/docs/mcp_tools.md +82 -0
  82. package/docs/messaging_templates.md +444 -0
  83. package/docs/metrics.md +462 -0
  84. package/docs/notebooks.md +838 -0
  85. package/docs/object_media_previews.md +228 -0
  86. package/docs/organizations.md +2958 -0
  87. package/docs/persons.md +1514 -0
  88. package/docs/platform_features.md +700 -0
  89. package/docs/plugin_configs.md +70 -0
  90. package/docs/product_enablement.md +39 -0
  91. package/docs/product_tours.md +357 -0
  92. package/docs/project_secret_api_keys.md +444 -0
  93. package/docs/property_access_controls.md +200 -0
  94. package/docs/property_definitions.md +244 -0
  95. package/docs/query.md +560 -0
  96. package/docs/quota_limits.md +40 -0
  97. package/docs/reminders.md +194 -0
  98. package/docs/replay.md +1020 -0
  99. package/docs/reverse_proxy.md +200 -0
  100. package/docs/sandbox-custom-images.md +209 -0
  101. package/docs/sandbox-environments.md +168 -0
  102. package/docs/saved.md +392 -0
  103. package/docs/saved_query_column_annotations.md +224 -0
  104. package/docs/scheduled_changes.md +200 -0
  105. package/docs/schema_property_groups.md +194 -0
  106. package/docs/sdk_health.md +40 -0
  107. package/docs/session_group_summaries.md +200 -0
  108. package/docs/session_recordings.md +260 -0
  109. package/docs/session_summaries.md +200 -0
  110. package/docs/sessions.md +132 -0
  111. package/docs/signals.md +1428 -0
  112. package/docs/single_session_summaries.md +72 -0
  113. package/docs/streamlit_apps.md +456 -0
  114. package/docs/subscriptions.md +634 -0
  115. package/docs/surveys.md +731 -0
  116. package/docs/taggers.md +446 -0
  117. package/docs/task-automations.md +200 -0
  118. package/docs/task-runs.md +654 -0
  119. package/docs/task_channels.md +136 -0
  120. package/docs/task_mentions.md +40 -0
  121. package/docs/tasks.md +776 -0
  122. package/docs/tracing.md +1186 -0
  123. package/docs/uploaded_media.md +44 -0
  124. package/docs/user_home_settings.md +72 -0
  125. package/docs/user_interview_topics.md +1288 -0
  126. package/docs/user_interviews.md +444 -0
  127. package/docs/users.md +1267 -0
  128. package/docs/vision.md +2022 -0
  129. package/docs/visual_review.md +816 -0
  130. package/docs/warehouse_column_annotations.md +224 -0
  131. package/docs/warehouse_column_statistics.md +80 -0
  132. package/docs/warehouse_dag.md +40 -0
  133. package/docs/warehouse_model_paths.md +70 -0
  134. package/docs/warehouse_saved_queries.md +1056 -0
  135. package/docs/warehouse_saved_query_folders.md +318 -0
  136. package/docs/warehouse_tables.md +584 -0
  137. package/docs/warehouse_view_link.md +456 -0
  138. package/docs/warehouse_view_links.md +456 -0
  139. package/docs/web_analytics.md +136 -0
  140. package/docs/web_analytics_achievements.md +200 -0
  141. package/docs/web_experiments.md +194 -0
  142. package/docs/web_vitals.md +74 -0
  143. package/docs/wizard.md +170 -0
  144. package/index.ts +22 -0
  145. package/metadata.ts +41419 -0
  146. package/openapi.json +297382 -0
  147. package/overlay.yaml +23 -0
  148. package/package.json +34 -0
  149. package/provenance.json +24 -0
  150. package/research.json +80 -0
  151. package/types/index.ts +17547 -0
@@ -0,0 +1,2296 @@
1
+ # External Data Sources
2
+
3
+ ## Operations
4
+
5
+ ### `posthog.environmentsExternalDataSourcesList`
6
+
7
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/`
8
+ - **What it does**: Create, Read, Update and Delete External data Sources.
9
+ - **OpenAPI operationId**: `environments_external_data_sources_list`
10
+ - **Path params**: None
11
+ - **Query params**: `limit`, `offset`, `search`
12
+ - **Response codes**: `200`
13
+ - **Transport options**: None
14
+ - **TypeScript**: [Client interface](../types.ts)
15
+
16
+ **Inputs**
17
+
18
+ - Client input type: `{ [key: string]: unknown }`
19
+ - Client transport options: None
20
+
21
+ **Outputs**
22
+
23
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; ...`
24
+ - OpenAPI response codes: `200`
25
+
26
+ ```ts
27
+ import posthog from "@utdk/posthog";
28
+
29
+ type EnvironmentsExternalDataSourcesListInput = Parameters<typeof posthog.environmentsExternalDataSourcesList> extends [infer T, ...unknown[]] ? T : undefined;
30
+ type EnvironmentsExternalDataSourcesListOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesList>>;
31
+
32
+ const result: EnvironmentsExternalDataSourcesListOutput = await posthog.environmentsExternalDataSourcesList();
33
+
34
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; ...
35
+ ```
36
+
37
+ ### `posthog.environmentsExternalDataSourcesCreate`
38
+
39
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/`
40
+ - **What it does**: Create, Read, Update and Delete External data Sources.
41
+ - **OpenAPI operationId**: `environments_external_data_sources_create`
42
+ - **Path params**: None
43
+ - **Query params**: None
44
+ - **Response codes**: `201`
45
+ - **Transport options**: None
46
+ - **TypeScript**: [Client interface](../types.ts)
47
+
48
+ **Inputs**
49
+
50
+ - Client input type: `{ [key: string]: unknown }`
51
+ - Client transport options: None
52
+
53
+ **Outputs**
54
+
55
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
56
+ - OpenAPI response codes: `201`
57
+
58
+ ```ts
59
+ import posthog from "@utdk/posthog";
60
+
61
+ type EnvironmentsExternalDataSourcesCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesCreate> extends [infer T, ...unknown[]] ? T : undefined;
62
+ type EnvironmentsExternalDataSourcesCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesCreate>>;
63
+
64
+ const result: EnvironmentsExternalDataSourcesCreateOutput = await posthog.environmentsExternalDataSourcesCreate();
65
+
66
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
67
+ ```
68
+
69
+ ### `posthog.environmentsExternalDataSourcesDestroy`
70
+
71
+ - **HTTP**: `DELETE /api/environments/{environment_id}/external_data_sources/{id}/`
72
+ - **What it does**: Create, Read, Update and Delete External data Sources.
73
+ - **OpenAPI operationId**: `environments_external_data_sources_destroy`
74
+ - **Path params**: `id`
75
+ - **Query params**: None
76
+ - **Response codes**: `204`
77
+ - **Transport options**: None
78
+ - **TypeScript**: [Client interface](../types.ts)
79
+
80
+ **Inputs**
81
+
82
+ - Client input type: `{ [key: string]: unknown }`
83
+ - Client transport options: None
84
+
85
+ **Outputs**
86
+
87
+ - Client return type: `unknown`
88
+ - OpenAPI response codes: `204`
89
+
90
+ ```ts
91
+ import posthog from "@utdk/posthog";
92
+
93
+ type EnvironmentsExternalDataSourcesDestroyInput = Parameters<typeof posthog.environmentsExternalDataSourcesDestroy> extends [infer T, ...unknown[]] ? T : undefined;
94
+ type EnvironmentsExternalDataSourcesDestroyOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesDestroy>>;
95
+
96
+ const result: EnvironmentsExternalDataSourcesDestroyOutput = await posthog.environmentsExternalDataSourcesDestroy();
97
+
98
+ // Result shape (from schema): unknown
99
+ ```
100
+
101
+ ### `posthog.environmentsExternalDataSourcesRetrieve`
102
+
103
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/{id}/`
104
+ - **What it does**: Create, Read, Update and Delete External data Sources.
105
+ - **OpenAPI operationId**: `environments_external_data_sources_retrieve`
106
+ - **Path params**: `id`
107
+ - **Query params**: None
108
+ - **Response codes**: `200`
109
+ - **Transport options**: None
110
+ - **TypeScript**: [Client interface](../types.ts)
111
+
112
+ **Inputs**
113
+
114
+ - Client input type: `{ [key: string]: unknown }`
115
+ - Client transport options: None
116
+
117
+ **Outputs**
118
+
119
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
120
+ - OpenAPI response codes: `200`
121
+
122
+ ```ts
123
+ import posthog from "@utdk/posthog";
124
+
125
+ type EnvironmentsExternalDataSourcesRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
126
+ type EnvironmentsExternalDataSourcesRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesRetrieve>>;
127
+
128
+ const result: EnvironmentsExternalDataSourcesRetrieveOutput = await posthog.environmentsExternalDataSourcesRetrieve();
129
+
130
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
131
+ ```
132
+
133
+ ### `posthog.environmentsExternalDataSourcesPartialUpdate`
134
+
135
+ - **HTTP**: `PATCH /api/environments/{environment_id}/external_data_sources/{id}/`
136
+ - **What it does**: Create, Read, Update and Delete External data Sources.
137
+ - **OpenAPI operationId**: `environments_external_data_sources_partial_update`
138
+ - **Path params**: `id`
139
+ - **Query params**: None
140
+ - **Response codes**: `200`
141
+ - **Transport options**: None
142
+ - **TypeScript**: [Client interface](../types.ts)
143
+
144
+ **Inputs**
145
+
146
+ - Client input type: `{ [key: string]: unknown }`
147
+ - Client transport options: None
148
+
149
+ **Outputs**
150
+
151
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
152
+ - OpenAPI response codes: `200`
153
+
154
+ ```ts
155
+ import posthog from "@utdk/posthog";
156
+
157
+ type EnvironmentsExternalDataSourcesPartialUpdateInput = Parameters<typeof posthog.environmentsExternalDataSourcesPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
158
+ type EnvironmentsExternalDataSourcesPartialUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesPartialUpdate>>;
159
+
160
+ const result: EnvironmentsExternalDataSourcesPartialUpdateOutput = await posthog.environmentsExternalDataSourcesPartialUpdate();
161
+
162
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
163
+ ```
164
+
165
+ ### `posthog.environmentsExternalDataSourcesUpdate`
166
+
167
+ - **HTTP**: `PUT /api/environments/{environment_id}/external_data_sources/{id}/`
168
+ - **What it does**: Create, Read, Update and Delete External data Sources.
169
+ - **OpenAPI operationId**: `environments_external_data_sources_update`
170
+ - **Path params**: `id`
171
+ - **Query params**: None
172
+ - **Response codes**: `200`
173
+ - **Transport options**: None
174
+ - **TypeScript**: [Client interface](../types.ts)
175
+
176
+ **Inputs**
177
+
178
+ - Client input type: `{ [key: string]: unknown }`
179
+ - Client transport options: None
180
+
181
+ **Outputs**
182
+
183
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
184
+ - OpenAPI response codes: `200`
185
+
186
+ ```ts
187
+ import posthog from "@utdk/posthog";
188
+
189
+ type EnvironmentsExternalDataSourcesUpdateInput = Parameters<typeof posthog.environmentsExternalDataSourcesUpdate> extends [infer T, ...unknown[]] ? T : undefined;
190
+ type EnvironmentsExternalDataSourcesUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesUpdate>>;
191
+
192
+ const result: EnvironmentsExternalDataSourcesUpdateOutput = await posthog.environmentsExternalDataSourcesUpdate();
193
+
194
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
195
+ ```
196
+
197
+ ### `posthog.environmentsExternalDataSourcesBulkUpdateSchemasPartialUpdate`
198
+
199
+ - **HTTP**: `PATCH /api/environments/{environment_id}/external_data_sources/{id}/bulk_update_schemas/`
200
+ - **What it does**: Create, Read, Update and Delete External data Sources.
201
+ - **OpenAPI operationId**: `environments_external_data_sources_bulk_update_schemas_partial_update`
202
+ - **Path params**: `id`
203
+ - **Query params**: `limit`, `offset`, `search`
204
+ - **Response codes**: `200`
205
+ - **Transport options**: None
206
+ - **TypeScript**: [Client interface](../types.ts)
207
+
208
+ **Inputs**
209
+
210
+ - Client input type: `{ [key: string]: unknown }`
211
+ - Client transport options: None
212
+
213
+ **Outputs**
214
+
215
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; label: string | null; table: { [key: string]: unknown } | null; should_sync?: boolean; last_synced_at: string | null...`
216
+ - OpenAPI response codes: `200`
217
+
218
+ ```ts
219
+ import posthog from "@utdk/posthog";
220
+
221
+ type EnvironmentsExternalDataSourcesBulkUpdateSchemasPartialUpdateInput = Parameters<typeof posthog.environmentsExternalDataSourcesBulkUpdateSchemasPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
222
+ type EnvironmentsExternalDataSourcesBulkUpdateSchemasPartialUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesBulkUpdateSchemasPartialUpdate>>;
223
+
224
+ const result: EnvironmentsExternalDataSourcesBulkUpdateSchemasPartialUpdateOutput = await posthog.environmentsExternalDataSourcesBulkUpdateSchemasPartialUpdate();
225
+
226
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; label: string | null; table: { [key: string]: unknown } | null; should_sync?: boolean; last_synced_at: string | null...
227
+ ```
228
+
229
+ ### `posthog.environmentsExternalDataSourcesCdcStatusRetrieve`
230
+
231
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/{id}/cdc_status/`
232
+ - **What it does**: Live CDC health for an existing source: slot/publication existence and WAL lag.
233
+
234
+ Reads from the source DB via the engine adapter. Returns ``{"enabled": false}``
235
+ when CDC is off, or the stored config plus live ``slot_exists`` /
236
+ ``publication_exists`` / ``lag_bytes`` when on. 400s if the source DB is
237
+ unreachable so the UI can show a degraded/unreachable state.
238
+ - **OpenAPI operationId**: `environments_external_data_sources_cdc_status_retrieve`
239
+ - **Path params**: `id`
240
+ - **Query params**: None
241
+ - **Response codes**: `200`
242
+ - **Transport options**: None
243
+ - **TypeScript**: [Client interface](../types.ts)
244
+
245
+ **Inputs**
246
+
247
+ - Client input type: `{ [key: string]: unknown }`
248
+ - Client transport options: None
249
+
250
+ **Outputs**
251
+
252
+ - Client return type: `unknown`
253
+ - OpenAPI response codes: `200`
254
+
255
+ ```ts
256
+ import posthog from "@utdk/posthog";
257
+
258
+ type EnvironmentsExternalDataSourcesCdcStatusRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesCdcStatusRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
259
+ type EnvironmentsExternalDataSourcesCdcStatusRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesCdcStatusRetrieve>>;
260
+
261
+ const result: EnvironmentsExternalDataSourcesCdcStatusRetrieveOutput = await posthog.environmentsExternalDataSourcesCdcStatusRetrieve();
262
+
263
+ // Result shape (from schema): unknown
264
+ ```
265
+
266
+ ### `posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreate`
267
+
268
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/check_cdc_prerequisites_for_source/`
269
+ - **What it does**: Validate CDC prerequisites for an existing source using its stored credentials.
270
+
271
+ The detail=False ``check_cdc_prerequisites`` action is for the creation wizard,
272
+ where the client still holds the raw connection config (incl. password) in the
273
+ form. On the Configuration page the source already exists and secret fields are
274
+ stripped from API responses — so the client can't supply them. This reads the
275
+ stored (encrypted) credentials from the DB via the adapter instead.
276
+
277
+ Body params: ``cdc_management_mode`` (``"posthog"`` | ``"self_managed"``),
278
+ ``cdc_slot_name`` (optional), ``cdc_publication_name`` (optional).
279
+ - **OpenAPI operationId**: `environments_external_data_sources_check_cdc_prerequisites_for_source_create`
280
+ - **Path params**: `id`
281
+ - **Query params**: None
282
+ - **Response codes**: `200`
283
+ - **Transport options**: None
284
+ - **TypeScript**: [Client interface](../types.ts)
285
+
286
+ **Inputs**
287
+
288
+ - Client input type: `{ [key: string]: unknown }`
289
+ - Client transport options: None
290
+
291
+ **Outputs**
292
+
293
+ - Client return type: `unknown`
294
+ - OpenAPI response codes: `200`
295
+
296
+ ```ts
297
+ import posthog from "@utdk/posthog";
298
+
299
+ type EnvironmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreate> extends [infer T, ...unknown[]] ? T : undefined;
300
+ type EnvironmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreate>>;
301
+
302
+ const result: EnvironmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreateOutput = await posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesForSourceCreate();
303
+
304
+ // Result shape (from schema): unknown
305
+ ```
306
+
307
+ ### `posthog.environmentsExternalDataSourcesCreateWebhookCreate`
308
+
309
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/create_webhook/`
310
+ - **What it does**: Create, Read, Update and Delete External data Sources.
311
+ - **OpenAPI operationId**: `environments_external_data_sources_create_webhook_create`
312
+ - **Path params**: `id`
313
+ - **Query params**: None
314
+ - **Response codes**: `200`
315
+ - **Transport options**: None
316
+ - **TypeScript**: [Client interface](../types.ts)
317
+
318
+ **Inputs**
319
+
320
+ - Client input type: `{ [key: string]: unknown }`
321
+ - Client transport options: None
322
+
323
+ **Outputs**
324
+
325
+ - Client return type: `unknown`
326
+ - OpenAPI response codes: `200`
327
+
328
+ ```ts
329
+ import posthog from "@utdk/posthog";
330
+
331
+ type EnvironmentsExternalDataSourcesCreateWebhookCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesCreateWebhookCreate> extends [infer T, ...unknown[]] ? T : undefined;
332
+ type EnvironmentsExternalDataSourcesCreateWebhookCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesCreateWebhookCreate>>;
333
+
334
+ const result: EnvironmentsExternalDataSourcesCreateWebhookCreateOutput = await posthog.environmentsExternalDataSourcesCreateWebhookCreate();
335
+
336
+ // Result shape (from schema): unknown
337
+ ```
338
+
339
+ ### `posthog.environmentsExternalDataSourcesDeleteWebhookCreate`
340
+
341
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/delete_webhook/`
342
+ - **What it does**: Create, Read, Update and Delete External data Sources.
343
+ - **OpenAPI operationId**: `environments_external_data_sources_delete_webhook_create`
344
+ - **Path params**: `id`
345
+ - **Query params**: None
346
+ - **Response codes**: `200`
347
+ - **Transport options**: None
348
+ - **TypeScript**: [Client interface](../types.ts)
349
+
350
+ **Inputs**
351
+
352
+ - Client input type: `{ [key: string]: unknown }`
353
+ - Client transport options: None
354
+
355
+ **Outputs**
356
+
357
+ - Client return type: `unknown`
358
+ - OpenAPI response codes: `200`
359
+
360
+ ```ts
361
+ import posthog from "@utdk/posthog";
362
+
363
+ type EnvironmentsExternalDataSourcesDeleteWebhookCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesDeleteWebhookCreate> extends [infer T, ...unknown[]] ? T : undefined;
364
+ type EnvironmentsExternalDataSourcesDeleteWebhookCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesDeleteWebhookCreate>>;
365
+
366
+ const result: EnvironmentsExternalDataSourcesDeleteWebhookCreateOutput = await posthog.environmentsExternalDataSourcesDeleteWebhookCreate();
367
+
368
+ // Result shape (from schema): unknown
369
+ ```
370
+
371
+ ### `posthog.environmentsExternalDataSourcesDisableCdcCreate`
372
+
373
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/disable_cdc/`
374
+ - **What it does**: Disable CDC on an existing source.
375
+
376
+ Cancels any running CDC extraction workflow, deletes the extraction schedule,
377
+ delegates engine-side teardown to the source's adapter (drops slot/publication
378
+ for Postgres; equivalent for other engines), clears ``cdc_*`` keys from
379
+ ``job_inputs``, soft-deletes companion CDC tables, and sets all CDC schemas to
380
+ ``sync_type=None``, ``should_sync=False`` so the user must pick a new sync
381
+ strategy before they resume.
382
+ - **OpenAPI operationId**: `environments_external_data_sources_disable_cdc_create`
383
+ - **Path params**: `id`
384
+ - **Query params**: None
385
+ - **Response codes**: `200`
386
+ - **Transport options**: None
387
+ - **TypeScript**: [Client interface](../types.ts)
388
+
389
+ **Inputs**
390
+
391
+ - Client input type: `{ [key: string]: unknown }`
392
+ - Client transport options: None
393
+
394
+ **Outputs**
395
+
396
+ - Client return type: `unknown`
397
+ - OpenAPI response codes: `200`
398
+
399
+ ```ts
400
+ import posthog from "@utdk/posthog";
401
+
402
+ type EnvironmentsExternalDataSourcesDisableCdcCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesDisableCdcCreate> extends [infer T, ...unknown[]] ? T : undefined;
403
+ type EnvironmentsExternalDataSourcesDisableCdcCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesDisableCdcCreate>>;
404
+
405
+ const result: EnvironmentsExternalDataSourcesDisableCdcCreateOutput = await posthog.environmentsExternalDataSourcesDisableCdcCreate();
406
+
407
+ // Result shape (from schema): unknown
408
+ ```
409
+
410
+ ### `posthog.environmentsExternalDataSourcesEnableCdcCreate`
411
+
412
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/enable_cdc/`
413
+ - **What it does**: Enable CDC on an existing source.
414
+
415
+ Provisions engine-side CDC resources via the source's adapter, writes the CDC
416
+ config into ``source.job_inputs``, and ensures the CDC extraction schedule
417
+ exists. Re-runs prereq checks server-side so we never trust a stale
418
+ client-side check.
419
+
420
+ Body params: ``cdc_management_mode`` (``"posthog"`` | ``"self_managed"``),
421
+ plus engine-specific identifier hints (e.g. ``cdc_slot_name``,
422
+ ``cdc_publication_name`` for Postgres). Universal tuning fields:
423
+ ``cdc_auto_drop_slot`` (optional bool), ``cdc_lag_warning_threshold_mb``
424
+ (optional int), ``cdc_lag_critical_threshold_mb`` (optional int).
425
+ - **OpenAPI operationId**: `environments_external_data_sources_enable_cdc_create`
426
+ - **Path params**: `id`
427
+ - **Query params**: None
428
+ - **Response codes**: `200`
429
+ - **Transport options**: None
430
+ - **TypeScript**: [Client interface](../types.ts)
431
+
432
+ **Inputs**
433
+
434
+ - Client input type: `{ [key: string]: unknown }`
435
+ - Client transport options: None
436
+
437
+ **Outputs**
438
+
439
+ - Client return type: `unknown`
440
+ - OpenAPI response codes: `200`
441
+
442
+ ```ts
443
+ import posthog from "@utdk/posthog";
444
+
445
+ type EnvironmentsExternalDataSourcesEnableCdcCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesEnableCdcCreate> extends [infer T, ...unknown[]] ? T : undefined;
446
+ type EnvironmentsExternalDataSourcesEnableCdcCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesEnableCdcCreate>>;
447
+
448
+ const result: EnvironmentsExternalDataSourcesEnableCdcCreateOutput = await posthog.environmentsExternalDataSourcesEnableCdcCreate();
449
+
450
+ // Result shape (from schema): unknown
451
+ ```
452
+
453
+ ### `posthog.environmentsExternalDataSourcesJobsRetrieve`
454
+
455
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/{id}/jobs/`
456
+ - **What it does**: Create, Read, Update and Delete External data Sources.
457
+ - **OpenAPI operationId**: `environments_external_data_sources_jobs_retrieve`
458
+ - **Path params**: `id`
459
+ - **Query params**: None
460
+ - **Response codes**: `200`
461
+ - **Transport options**: None
462
+ - **TypeScript**: [Client interface](../types.ts)
463
+
464
+ **Inputs**
465
+
466
+ - Client input type: `{ [key: string]: unknown }`
467
+ - Client transport options: None
468
+
469
+ **Outputs**
470
+
471
+ - Client return type: `unknown`
472
+ - OpenAPI response codes: `200`
473
+
474
+ ```ts
475
+ import posthog from "@utdk/posthog";
476
+
477
+ type EnvironmentsExternalDataSourcesJobsRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesJobsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
478
+ type EnvironmentsExternalDataSourcesJobsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesJobsRetrieve>>;
479
+
480
+ const result: EnvironmentsExternalDataSourcesJobsRetrieveOutput = await posthog.environmentsExternalDataSourcesJobsRetrieve();
481
+
482
+ // Result shape (from schema): unknown
483
+ ```
484
+
485
+ ### `posthog.environmentsExternalDataSourcesRefreshSchemasCreate`
486
+
487
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/refresh_schemas/`
488
+ - **What it does**: Fetch current schema/table list from the source and create any new ExternalDataSchema rows (no data sync).
489
+ - **OpenAPI operationId**: `environments_external_data_sources_refresh_schemas_create`
490
+ - **Path params**: `id`
491
+ - **Query params**: None
492
+ - **Response codes**: `200`
493
+ - **Transport options**: None
494
+ - **TypeScript**: [Client interface](../types.ts)
495
+
496
+ **Inputs**
497
+
498
+ - Client input type: `{ [key: string]: unknown }`
499
+ - Client transport options: None
500
+
501
+ **Outputs**
502
+
503
+ - Client return type: `unknown`
504
+ - OpenAPI response codes: `200`
505
+
506
+ ```ts
507
+ import posthog from "@utdk/posthog";
508
+
509
+ type EnvironmentsExternalDataSourcesRefreshSchemasCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesRefreshSchemasCreate> extends [infer T, ...unknown[]] ? T : undefined;
510
+ type EnvironmentsExternalDataSourcesRefreshSchemasCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesRefreshSchemasCreate>>;
511
+
512
+ const result: EnvironmentsExternalDataSourcesRefreshSchemasCreateOutput = await posthog.environmentsExternalDataSourcesRefreshSchemasCreate();
513
+
514
+ // Result shape (from schema): unknown
515
+ ```
516
+
517
+ ### `posthog.environmentsExternalDataSourcesReloadCreate`
518
+
519
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/reload/`
520
+ - **What it does**: Create, Read, Update and Delete External data Sources.
521
+ - **OpenAPI operationId**: `environments_external_data_sources_reload_create`
522
+ - **Path params**: `id`
523
+ - **Query params**: None
524
+ - **Response codes**: `200`
525
+ - **Transport options**: None
526
+ - **TypeScript**: [Client interface](../types.ts)
527
+
528
+ **Inputs**
529
+
530
+ - Client input type: `{ [key: string]: unknown }`
531
+ - Client transport options: None
532
+
533
+ **Outputs**
534
+
535
+ - Client return type: `unknown`
536
+ - OpenAPI response codes: `200`
537
+
538
+ ```ts
539
+ import posthog from "@utdk/posthog";
540
+
541
+ type EnvironmentsExternalDataSourcesReloadCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesReloadCreate> extends [infer T, ...unknown[]] ? T : undefined;
542
+ type EnvironmentsExternalDataSourcesReloadCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesReloadCreate>>;
543
+
544
+ const result: EnvironmentsExternalDataSourcesReloadCreateOutput = await posthog.environmentsExternalDataSourcesReloadCreate();
545
+
546
+ // Result shape (from schema): unknown
547
+ ```
548
+
549
+ ### `posthog.environmentsExternalDataSourcesRepairCdcCreate`
550
+
551
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/repair_cdc/`
552
+ - **What it does**: Repair CDC on a source whose replication resources were lost.
553
+
554
+ Only proceeds on evidence of breakage (a persisted broken marker, or a live probe
555
+ showing the slot/publication missing) — repairing a healthy source would drop its
556
+ slot and force a full re-sync. Cancels running CDC jobs, recreates the engine-side
557
+ slot/publication against the stored CDC config, resets every active CDC schema to
558
+ snapshot mode for a full re-sync (changes since the old slot died are
559
+ unrecoverable), clears the broken markers, and resumes the paused schedules.
560
+ Idempotent: safe to retry after a partial failure. Concurrent repairs of the same
561
+ source are rejected with a 409.
562
+ - **OpenAPI operationId**: `environments_external_data_sources_repair_cdc_create`
563
+ - **Path params**: `id`
564
+ - **Query params**: None
565
+ - **Response codes**: `200`, `400`, `409`
566
+ - **Transport options**: None
567
+ - **TypeScript**: [Client interface](../types.ts)
568
+
569
+ **Inputs**
570
+
571
+ - Client input type: `{ [key: string]: unknown }`
572
+ - Client transport options: None
573
+
574
+ **Outputs**
575
+
576
+ - Client return type: `{ success?: boolean; schemas_reset?: number }`
577
+ - OpenAPI response codes: `200`, `400`, `409`
578
+
579
+ ```ts
580
+ import posthog from "@utdk/posthog";
581
+
582
+ type EnvironmentsExternalDataSourcesRepairCdcCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesRepairCdcCreate> extends [infer T, ...unknown[]] ? T : undefined;
583
+ type EnvironmentsExternalDataSourcesRepairCdcCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesRepairCdcCreate>>;
584
+
585
+ const result: EnvironmentsExternalDataSourcesRepairCdcCreateOutput = await posthog.environmentsExternalDataSourcesRepairCdcCreate();
586
+
587
+ // Result shape (from schema): { success?: boolean; schemas_reset?: number }
588
+ ```
589
+
590
+ ### `posthog.environmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdate`
591
+
592
+ - **HTTP**: `PATCH /api/environments/{environment_id}/external_data_sources/{id}/revenue_analytics_config/`
593
+ - **What it does**: Update the revenue analytics configuration and return the full external data source.
594
+ - **OpenAPI operationId**: `environments_external_data_sources_revenue_analytics_config_partial_update`
595
+ - **Path params**: `id`
596
+ - **Query params**: None
597
+ - **Response codes**: `200`
598
+ - **Transport options**: None
599
+ - **TypeScript**: [Client interface](../types.ts)
600
+
601
+ **Inputs**
602
+
603
+ - Client input type: `{ [key: string]: unknown }`
604
+ - Client transport options: None
605
+
606
+ **Outputs**
607
+
608
+ - Client return type: `unknown`
609
+ - OpenAPI response codes: `200`
610
+
611
+ ```ts
612
+ import posthog from "@utdk/posthog";
613
+
614
+ type EnvironmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdateInput = Parameters<typeof posthog.environmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
615
+ type EnvironmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdate>>;
616
+
617
+ const result: EnvironmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdateOutput = await posthog.environmentsExternalDataSourcesRevenueAnalyticsConfigPartialUpdate();
618
+
619
+ // Result shape (from schema): unknown
620
+ ```
621
+
622
+ ### `posthog.environmentsExternalDataSourcesUpdateCdcSettingsCreate`
623
+
624
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/update_cdc_settings/`
625
+ - **What it does**: Update CDC tuning fields without enabling/disabling.
626
+
627
+ Lets users edit ``cdc_auto_drop_slot``, ``cdc_lag_warning_threshold_mb``, and
628
+ ``cdc_lag_critical_threshold_mb`` independently. These fields are universal
629
+ across engines. Engine-specific identifiers (slot name, management mode, …)
630
+ are immutable post-enable — switching them requires disable + enable.
631
+ - **OpenAPI operationId**: `environments_external_data_sources_update_cdc_settings_create`
632
+ - **Path params**: `id`
633
+ - **Query params**: None
634
+ - **Response codes**: `200`
635
+ - **Transport options**: None
636
+ - **TypeScript**: [Client interface](../types.ts)
637
+
638
+ **Inputs**
639
+
640
+ - Client input type: `{ [key: string]: unknown }`
641
+ - Client transport options: None
642
+
643
+ **Outputs**
644
+
645
+ - Client return type: `unknown`
646
+ - OpenAPI response codes: `200`
647
+
648
+ ```ts
649
+ import posthog from "@utdk/posthog";
650
+
651
+ type EnvironmentsExternalDataSourcesUpdateCdcSettingsCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesUpdateCdcSettingsCreate> extends [infer T, ...unknown[]] ? T : undefined;
652
+ type EnvironmentsExternalDataSourcesUpdateCdcSettingsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesUpdateCdcSettingsCreate>>;
653
+
654
+ const result: EnvironmentsExternalDataSourcesUpdateCdcSettingsCreateOutput = await posthog.environmentsExternalDataSourcesUpdateCdcSettingsCreate();
655
+
656
+ // Result shape (from schema): unknown
657
+ ```
658
+
659
+ ### `posthog.environmentsExternalDataSourcesUpdateWebhookInputsCreate`
660
+
661
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/{id}/update_webhook_inputs/`
662
+ - **What it does**: Create, Read, Update and Delete External data Sources.
663
+ - **OpenAPI operationId**: `environments_external_data_sources_update_webhook_inputs_create`
664
+ - **Path params**: `id`
665
+ - **Query params**: None
666
+ - **Response codes**: `200`
667
+ - **Transport options**: None
668
+ - **TypeScript**: [Client interface](../types.ts)
669
+
670
+ **Inputs**
671
+
672
+ - Client input type: `{ [key: string]: unknown }`
673
+ - Client transport options: None
674
+
675
+ **Outputs**
676
+
677
+ - Client return type: `unknown`
678
+ - OpenAPI response codes: `200`
679
+
680
+ ```ts
681
+ import posthog from "@utdk/posthog";
682
+
683
+ type EnvironmentsExternalDataSourcesUpdateWebhookInputsCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesUpdateWebhookInputsCreate> extends [infer T, ...unknown[]] ? T : undefined;
684
+ type EnvironmentsExternalDataSourcesUpdateWebhookInputsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesUpdateWebhookInputsCreate>>;
685
+
686
+ const result: EnvironmentsExternalDataSourcesUpdateWebhookInputsCreateOutput = await posthog.environmentsExternalDataSourcesUpdateWebhookInputsCreate();
687
+
688
+ // Result shape (from schema): unknown
689
+ ```
690
+
691
+ ### `posthog.environmentsExternalDataSourcesWebhookInfoRetrieve`
692
+
693
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/{id}/webhook_info/`
694
+ - **What it does**: Create, Read, Update and Delete External data Sources.
695
+ - **OpenAPI operationId**: `environments_external_data_sources_webhook_info_retrieve`
696
+ - **Path params**: `id`
697
+ - **Query params**: None
698
+ - **Response codes**: `200`
699
+ - **Transport options**: None
700
+ - **TypeScript**: [Client interface](../types.ts)
701
+
702
+ **Inputs**
703
+
704
+ - Client input type: `{ [key: string]: unknown }`
705
+ - Client transport options: None
706
+
707
+ **Outputs**
708
+
709
+ - Client return type: `unknown`
710
+ - OpenAPI response codes: `200`
711
+
712
+ ```ts
713
+ import posthog from "@utdk/posthog";
714
+
715
+ type EnvironmentsExternalDataSourcesWebhookInfoRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesWebhookInfoRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
716
+ type EnvironmentsExternalDataSourcesWebhookInfoRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesWebhookInfoRetrieve>>;
717
+
718
+ const result: EnvironmentsExternalDataSourcesWebhookInfoRetrieveOutput = await posthog.environmentsExternalDataSourcesWebhookInfoRetrieve();
719
+
720
+ // Result shape (from schema): unknown
721
+ ```
722
+
723
+ ### `posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesCreate`
724
+
725
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/check_cdc_prerequisites/`
726
+ - **What it does**: Validate CDC prerequisites against a live Postgres connection.
727
+
728
+ Used by the source wizard to surface ✅/❌ checks before source creation,
729
+ and by the self-managed setup popup to verify user-created publications.
730
+ - **OpenAPI operationId**: `environments_external_data_sources_check_cdc_prerequisites_create`
731
+ - **Path params**: None
732
+ - **Query params**: None
733
+ - **Response codes**: `200`, `400`
734
+ - **Transport options**: None
735
+ - **TypeScript**: [Client interface](../types.ts)
736
+
737
+ **Inputs**
738
+
739
+ - Client input type: `{ [key: string]: unknown }`
740
+ - Client transport options: None
741
+
742
+ **Outputs**
743
+
744
+ - Client return type: `{ valid?: boolean; errors?: (string)[] }`
745
+ - OpenAPI response codes: `200`, `400`
746
+
747
+ ```ts
748
+ import posthog from "@utdk/posthog";
749
+
750
+ type EnvironmentsExternalDataSourcesCheckCdcPrerequisitesCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesCreate> extends [infer T, ...unknown[]] ? T : undefined;
751
+ type EnvironmentsExternalDataSourcesCheckCdcPrerequisitesCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesCreate>>;
752
+
753
+ const result: EnvironmentsExternalDataSourcesCheckCdcPrerequisitesCreateOutput = await posthog.environmentsExternalDataSourcesCheckCdcPrerequisitesCreate();
754
+
755
+ // Result shape (from schema): { valid?: boolean; errors?: (string)[] }
756
+ ```
757
+
758
+ ### `posthog.environmentsExternalDataSourcesConnectLinkRetrieve`
759
+
760
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/connect_link/`
761
+ - **What it does**: Return a secure browser link for connecting a data warehouse source.
762
+
763
+ The link opens a minimal connect page rendering the source's full connection form — OAuth options
764
+ included — with no table selection and no source creation. The user authenticates in their browser,
765
+ secrets never pass through the agent, and the agent finishes setup afterwards by passing the stored
766
+ credential id to data-warehouse-source-setup.
767
+ - **OpenAPI operationId**: `environments_external_data_sources_connect_link_retrieve`
768
+ - **Path params**: None
769
+ - **Query params**: `source_type`
770
+ - **Response codes**: `200`
771
+ - **Transport options**: None
772
+ - **TypeScript**: [Client interface](../types.ts)
773
+
774
+ **Inputs**
775
+
776
+ - Client input type: `{ [key: string]: unknown }`
777
+ - Client transport options: None
778
+
779
+ **Outputs**
780
+
781
+ - Client return type: `{ source_type: string; auth_method: "oauth" | "credentials"; connect_url: string; instructions: string }`
782
+ - OpenAPI response codes: `200`
783
+
784
+ ```ts
785
+ import posthog from "@utdk/posthog";
786
+
787
+ type EnvironmentsExternalDataSourcesConnectLinkRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesConnectLinkRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
788
+ type EnvironmentsExternalDataSourcesConnectLinkRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesConnectLinkRetrieve>>;
789
+
790
+ const result: EnvironmentsExternalDataSourcesConnectLinkRetrieveOutput = await posthog.environmentsExternalDataSourcesConnectLinkRetrieve();
791
+
792
+ // Result shape (from schema): { source_type: string; auth_method: "oauth" | "credentials"; connect_url: string; instructions: string }
793
+ ```
794
+
795
+ ### `posthog.environmentsExternalDataSourcesConnectionsList`
796
+
797
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/connections/`
798
+ - **What it does**: Create, Read, Update and Delete External data Sources.
799
+ - **OpenAPI operationId**: `environments_external_data_sources_connections_list`
800
+ - **Path params**: None
801
+ - **Query params**: `limit`, `offset`, `search`
802
+ - **Response codes**: `200`
803
+ - **Transport options**: None
804
+ - **TypeScript**: [Client interface](../types.ts)
805
+
806
+ **Inputs**
807
+
808
+ - Client input type: `{ [key: string]: unknown }`
809
+ - Client transport options: None
810
+
811
+ **Outputs**
812
+
813
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; prefix: string | null; engine: "duckdb" | "postgres" | "mysql" | "snowflake" | null })[] }`
814
+ - OpenAPI response codes: `200`
815
+
816
+ ```ts
817
+ import posthog from "@utdk/posthog";
818
+
819
+ type EnvironmentsExternalDataSourcesConnectionsListInput = Parameters<typeof posthog.environmentsExternalDataSourcesConnectionsList> extends [infer T, ...unknown[]] ? T : undefined;
820
+ type EnvironmentsExternalDataSourcesConnectionsListOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesConnectionsList>>;
821
+
822
+ const result: EnvironmentsExternalDataSourcesConnectionsListOutput = await posthog.environmentsExternalDataSourcesConnectionsList();
823
+
824
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; prefix: string | null; engine: "duckdb" | "postgres" | "mysql" | "snowflake" | null })[] }
825
+ ```
826
+
827
+ ### `posthog.environmentsExternalDataSourcesDatabaseSchemaCreate`
828
+
829
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/database_schema/`
830
+ - **What it does**: Create, Read, Update and Delete External data Sources.
831
+ - **OpenAPI operationId**: `environments_external_data_sources_database_schema_create`
832
+ - **Path params**: None
833
+ - **Query params**: None
834
+ - **Response codes**: `200`
835
+ - **Transport options**: None
836
+ - **TypeScript**: [Client interface](../types.ts)
837
+
838
+ **Inputs**
839
+
840
+ - Client input type: `{ [key: string]: unknown }`
841
+ - Client transport options: None
842
+
843
+ **Outputs**
844
+
845
+ - Client return type: `unknown`
846
+ - OpenAPI response codes: `200`
847
+
848
+ ```ts
849
+ import posthog from "@utdk/posthog";
850
+
851
+ type EnvironmentsExternalDataSourcesDatabaseSchemaCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesDatabaseSchemaCreate> extends [infer T, ...unknown[]] ? T : undefined;
852
+ type EnvironmentsExternalDataSourcesDatabaseSchemaCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesDatabaseSchemaCreate>>;
853
+
854
+ const result: EnvironmentsExternalDataSourcesDatabaseSchemaCreateOutput = await posthog.environmentsExternalDataSourcesDatabaseSchemaCreate();
855
+
856
+ // Result shape (from schema): unknown
857
+ ```
858
+
859
+ ### `posthog.environmentsExternalDataSourcesDraftCustomManifestCreate`
860
+
861
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/draft_custom_manifest/`
862
+ - **What it does**: Draft a Custom REST source manifest from API documentation using an LLM.
863
+
864
+ Reads the docs (a URL fetched server-side, or pasted text / OpenAPI spec), asks the model to
865
+ author a RESTAPIConfig manifest, and validates it against the create-path checks — repairing
866
+ against validation errors up to a small budget. Returns the manifest for the user to review
867
+ and tweak in the builder before creating the source; it does NOT create anything. Gated by the
868
+ `dwh-custom-source-ai-builder` flag, and requires the org to have approved AI data processing,
869
+ since the docs are sent to the LLM gateway.
870
+ - **OpenAPI operationId**: `environments_external_data_sources_draft_custom_manifest_create`
871
+ - **Path params**: None
872
+ - **Query params**: None
873
+ - **Response codes**: `200`
874
+ - **Transport options**: None
875
+ - **TypeScript**: [Client interface](../types.ts)
876
+
877
+ **Inputs**
878
+
879
+ - Client input type: `{ [key: string]: unknown }`
880
+ - Client transport options: None
881
+
882
+ **Outputs**
883
+
884
+ - Client return type: `{ draft_status: "ok" | "invalid" | "model_error"; manifest_json: string | null; resource_names: (string)[]; attempts: number; error: string | null }`
885
+ - OpenAPI response codes: `200`
886
+
887
+ ```ts
888
+ import posthog from "@utdk/posthog";
889
+
890
+ type EnvironmentsExternalDataSourcesDraftCustomManifestCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesDraftCustomManifestCreate> extends [infer T, ...unknown[]] ? T : undefined;
891
+ type EnvironmentsExternalDataSourcesDraftCustomManifestCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesDraftCustomManifestCreate>>;
892
+
893
+ const result: EnvironmentsExternalDataSourcesDraftCustomManifestCreateOutput = await posthog.environmentsExternalDataSourcesDraftCustomManifestCreate();
894
+
895
+ // Result shape (from schema): { draft_status: "ok" | "invalid" | "model_error"; manifest_json: string | null; resource_names: (string)[]; attempts: number; error: string | null }
896
+ ```
897
+
898
+ ### `posthog.environmentsExternalDataSourcesOauthAccountsRetrieve`
899
+
900
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/oauth_accounts/`
901
+ - **What it does**: List the accounts/properties a connected OAuth integration exposes, in the shared
902
+ IntegrationAccount shape. The logic lives in each source (via OAuthMixin.get_oauth_accounts);
903
+ this endpoint just routes by source type and serializes the result.
904
+ - **OpenAPI operationId**: `environments_external_data_sources_oauth_accounts_retrieve`
905
+ - **Path params**: None
906
+ - **Query params**: `integration_id`, `source_type`
907
+ - **Response codes**: `200`
908
+ - **Transport options**: None
909
+ - **TypeScript**: [Client interface](../types.ts)
910
+
911
+ **Inputs**
912
+
913
+ - Client input type: `{ [key: string]: unknown }`
914
+ - Client transport options: None
915
+
916
+ **Outputs**
917
+
918
+ - Client return type: `{ accounts: ({ value: string; display_name: string; is_primary: boolean; badges: (string)[]; group: string | null; secondary_text: string | null })[] }`
919
+ - OpenAPI response codes: `200`
920
+
921
+ ```ts
922
+ import posthog from "@utdk/posthog";
923
+
924
+ type EnvironmentsExternalDataSourcesOauthAccountsRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesOauthAccountsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
925
+ type EnvironmentsExternalDataSourcesOauthAccountsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesOauthAccountsRetrieve>>;
926
+
927
+ const result: EnvironmentsExternalDataSourcesOauthAccountsRetrieveOutput = await posthog.environmentsExternalDataSourcesOauthAccountsRetrieve();
928
+
929
+ // Result shape (from schema): { accounts: ({ value: string; display_name: string; is_primary: boolean; badges: (string)[]; group: string | null; secondary_text: string | null })[] }
930
+ ```
931
+
932
+ ### `posthog.environmentsExternalDataSourcesPreviewResourceCreate`
933
+
934
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/preview_resource/`
935
+ - **What it does**: Read a bounded sample of rows for one resource of a Custom REST source.
936
+
937
+ Lets a manifest author verify `data_selector`, `primary_key`, and the incremental
938
+ `cursor_path` against live data before creating the source. Only `source_type: "Custom"`
939
+ is supported — other source types return 400. The read is bounded (single page per
940
+ resource, capped row count, short timeouts, no redirects). Manifest, validation, and SSRF
941
+ problems return 400; a live fetch failure returns 200 with `error` set and empty `rows`.
942
+ - **OpenAPI operationId**: `environments_external_data_sources_preview_resource_create`
943
+ - **Path params**: None
944
+ - **Query params**: None
945
+ - **Response codes**: `200`
946
+ - **Transport options**: None
947
+ - **TypeScript**: [Client interface](../types.ts)
948
+
949
+ **Inputs**
950
+
951
+ - Client input type: `{ [key: string]: unknown }`
952
+ - Client transport options: None
953
+
954
+ **Outputs**
955
+
956
+ - Client return type: `{ rows: ({ [key: string]: unknown })[]; row_count: number; columns: ({ name: string; type: string })[]; error: string | null }`
957
+ - OpenAPI response codes: `200`
958
+
959
+ ```ts
960
+ import posthog from "@utdk/posthog";
961
+
962
+ type EnvironmentsExternalDataSourcesPreviewResourceCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesPreviewResourceCreate> extends [infer T, ...unknown[]] ? T : undefined;
963
+ type EnvironmentsExternalDataSourcesPreviewResourceCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesPreviewResourceCreate>>;
964
+
965
+ const result: EnvironmentsExternalDataSourcesPreviewResourceCreateOutput = await posthog.environmentsExternalDataSourcesPreviewResourceCreate();
966
+
967
+ // Result shape (from schema): { rows: ({ [key: string]: unknown })[]; row_count: number; columns: ({ name: string; type: string })[]; error: string | null }
968
+ ```
969
+
970
+ ### `posthog.environmentsExternalDataSourcesSetupCreate`
971
+
972
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/setup/`
973
+ - **What it does**: One-shot data warehouse source setup.
974
+
975
+ Validate credentials, discover available tables, enable them all with sensible sync defaults
976
+ (incremental where supported, else append, else full refresh), and create the source in a single
977
+ call — the caller never has to assemble a `schemas` array. For sources that support webhooks
978
+ (e.g. Stripe), a webhook is auto-registered after creation: on success webhook-capable tables
979
+ switch to real-time webhook sync (unlocking webhook-only tables); on failure the polling
980
+ defaults stay in place. For fine-grained table/sync control, use the lower-level
981
+ `database_schema` + `create` flow instead.
982
+ - **OpenAPI operationId**: `environments_external_data_sources_setup_create`
983
+ - **Path params**: None
984
+ - **Query params**: None
985
+ - **Response codes**: `201`
986
+ - **Transport options**: None
987
+ - **TypeScript**: [Client interface](../types.ts)
988
+
989
+ **Inputs**
990
+
991
+ - Client input type: `{ [key: string]: unknown }`
992
+ - Client transport options: None
993
+
994
+ **Outputs**
995
+
996
+ - Client return type: `{ id: string; webhook?: { success: boolean; webhook_url: string | null; error: string | null; pending_inputs: (string)[] } }`
997
+ - OpenAPI response codes: `201`
998
+
999
+ ```ts
1000
+ import posthog from "@utdk/posthog";
1001
+
1002
+ type EnvironmentsExternalDataSourcesSetupCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesSetupCreate> extends [infer T, ...unknown[]] ? T : undefined;
1003
+ type EnvironmentsExternalDataSourcesSetupCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesSetupCreate>>;
1004
+
1005
+ const result: EnvironmentsExternalDataSourcesSetupCreateOutput = await posthog.environmentsExternalDataSourcesSetupCreate();
1006
+
1007
+ // Result shape (from schema): { id: string; webhook?: { success: boolean; webhook_url: string | null; error: string | null; pending_inputs: (string)[] } }
1008
+ ```
1009
+
1010
+ ### `posthog.environmentsExternalDataSourcesSourcePrefixCreate`
1011
+
1012
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/source_prefix/`
1013
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1014
+ - **OpenAPI operationId**: `environments_external_data_sources_source_prefix_create`
1015
+ - **Path params**: None
1016
+ - **Query params**: None
1017
+ - **Response codes**: `200`
1018
+ - **Transport options**: None
1019
+ - **TypeScript**: [Client interface](../types.ts)
1020
+
1021
+ **Inputs**
1022
+
1023
+ - Client input type: `{ [key: string]: unknown }`
1024
+ - Client transport options: None
1025
+
1026
+ **Outputs**
1027
+
1028
+ - Client return type: `unknown`
1029
+ - OpenAPI response codes: `200`
1030
+
1031
+ ```ts
1032
+ import posthog from "@utdk/posthog";
1033
+
1034
+ type EnvironmentsExternalDataSourcesSourcePrefixCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesSourcePrefixCreate> extends [infer T, ...unknown[]] ? T : undefined;
1035
+ type EnvironmentsExternalDataSourcesSourcePrefixCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesSourcePrefixCreate>>;
1036
+
1037
+ const result: EnvironmentsExternalDataSourcesSourcePrefixCreateOutput = await posthog.environmentsExternalDataSourcesSourcePrefixCreate();
1038
+
1039
+ // Result shape (from schema): unknown
1040
+ ```
1041
+
1042
+ ### `posthog.environmentsExternalDataSourcesStoreCredentialsCreate`
1043
+
1044
+ - **HTTP**: `POST /api/environments/{environment_id}/external_data_sources/store_credentials/`
1045
+ - **What it does**: Validate and store credentials for a data warehouse source without creating the source.
1046
+
1047
+ Backs the source connect page: the user enters credentials directly in PostHog, they are
1048
+ checked against a live connection, then stashed encrypted in a temporary store. The returned
1049
+ credential id can be passed to `setup` as {'credential_id': <id>} to create the source — so
1050
+ secrets never travel through an agent conversation. The stash is single-use: it is deleted
1051
+ as soon as `setup` consumes it, and expires after 24 hours if never consumed.
1052
+ - **OpenAPI operationId**: `environments_external_data_sources_store_credentials_create`
1053
+ - **Path params**: None
1054
+ - **Query params**: None
1055
+ - **Response codes**: `201`
1056
+ - **Transport options**: None
1057
+ - **TypeScript**: [Client interface](../types.ts)
1058
+
1059
+ **Inputs**
1060
+
1061
+ - Client input type: `{ [key: string]: unknown }`
1062
+ - Client transport options: None
1063
+
1064
+ **Outputs**
1065
+
1066
+ - Client return type: `{ credential_id: string; source_type: string; created_at: string; expires_at: string }`
1067
+ - OpenAPI response codes: `201`
1068
+
1069
+ ```ts
1070
+ import posthog from "@utdk/posthog";
1071
+
1072
+ type EnvironmentsExternalDataSourcesStoreCredentialsCreateInput = Parameters<typeof posthog.environmentsExternalDataSourcesStoreCredentialsCreate> extends [infer T, ...unknown[]] ? T : undefined;
1073
+ type EnvironmentsExternalDataSourcesStoreCredentialsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesStoreCredentialsCreate>>;
1074
+
1075
+ const result: EnvironmentsExternalDataSourcesStoreCredentialsCreateOutput = await posthog.environmentsExternalDataSourcesStoreCredentialsCreate();
1076
+
1077
+ // Result shape (from schema): { credential_id: string; source_type: string; created_at: string; expires_at: string }
1078
+ ```
1079
+
1080
+ ### `posthog.environmentsExternalDataSourcesStoredCredentialsList`
1081
+
1082
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/stored_credentials/`
1083
+ - **What it does**: List credentials stored via the source connect page that haven't been consumed yet.
1084
+
1085
+ Returns metadata only (id, source type, timestamps) — never the secrets themselves. Stored
1086
+ credentials are temporary: they disappear once consumed by `setup` or when they expire.
1087
+ Newest first, so after a user confirms they've finished the connect page, the first entry
1088
+ for the source type is the one to pass to `setup`.
1089
+ - **OpenAPI operationId**: `environments_external_data_sources_stored_credentials_list`
1090
+ - **Path params**: None
1091
+ - **Query params**: `search`, `source_type`
1092
+ - **Response codes**: `200`
1093
+ - **Transport options**: None
1094
+ - **TypeScript**: [Client interface](../types.ts)
1095
+
1096
+ **Inputs**
1097
+
1098
+ - Client input type: `{ [key: string]: unknown }`
1099
+ - Client transport options: None
1100
+
1101
+ **Outputs**
1102
+
1103
+ - Client return type: `({ credential_id: string; source_type: string; created_at: string; expires_at: string })[]`
1104
+ - OpenAPI response codes: `200`
1105
+
1106
+ ```ts
1107
+ import posthog from "@utdk/posthog";
1108
+
1109
+ type EnvironmentsExternalDataSourcesStoredCredentialsListInput = Parameters<typeof posthog.environmentsExternalDataSourcesStoredCredentialsList> extends [infer T, ...unknown[]] ? T : undefined;
1110
+ type EnvironmentsExternalDataSourcesStoredCredentialsListOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesStoredCredentialsList>>;
1111
+
1112
+ const result: EnvironmentsExternalDataSourcesStoredCredentialsListOutput = await posthog.environmentsExternalDataSourcesStoredCredentialsList();
1113
+
1114
+ // Result shape (from schema): ({ credential_id: string; source_type: string; created_at: string; expires_at: string })[]
1115
+ ```
1116
+
1117
+ ### `posthog.environmentsExternalDataSourcesWizardRetrieve`
1118
+
1119
+ - **HTTP**: `GET /api/environments/{environment_id}/external_data_sources/wizard/`
1120
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1121
+ - **OpenAPI operationId**: `environments_external_data_sources_wizard_retrieve`
1122
+ - **Path params**: None
1123
+ - **Query params**: `source_type`
1124
+ - **Response codes**: `200`
1125
+ - **Transport options**: None
1126
+ - **TypeScript**: [Client interface](../types.ts)
1127
+
1128
+ **Inputs**
1129
+
1130
+ - Client input type: `{ [key: string]: unknown }`
1131
+ - Client transport options: None
1132
+
1133
+ **Outputs**
1134
+
1135
+ - Client return type: `unknown`
1136
+ - OpenAPI response codes: `200`
1137
+
1138
+ ```ts
1139
+ import posthog from "@utdk/posthog";
1140
+
1141
+ type EnvironmentsExternalDataSourcesWizardRetrieveInput = Parameters<typeof posthog.environmentsExternalDataSourcesWizardRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1142
+ type EnvironmentsExternalDataSourcesWizardRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsExternalDataSourcesWizardRetrieve>>;
1143
+
1144
+ const result: EnvironmentsExternalDataSourcesWizardRetrieveOutput = await posthog.environmentsExternalDataSourcesWizardRetrieve();
1145
+
1146
+ // Result shape (from schema): unknown
1147
+ ```
1148
+
1149
+ ### `posthog.externalDataSourcesList`
1150
+
1151
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/`
1152
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1153
+ - **OpenAPI operationId**: `external_data_sources_list`
1154
+ - **Path params**: None
1155
+ - **Query params**: `limit`, `offset`, `search`
1156
+ - **Response codes**: `200`
1157
+ - **Transport options**: None
1158
+ - **TypeScript**: [Client interface](../types.ts)
1159
+
1160
+ **Inputs**
1161
+
1162
+ - Client input type: `{ [key: string]: unknown }`
1163
+ - Client transport options: None
1164
+
1165
+ **Outputs**
1166
+
1167
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; ...`
1168
+ - OpenAPI response codes: `200`
1169
+
1170
+ ```ts
1171
+ import posthog from "@utdk/posthog";
1172
+
1173
+ type ExternalDataSourcesListInput = Parameters<typeof posthog.externalDataSourcesList> extends [infer T, ...unknown[]] ? T : undefined;
1174
+ type ExternalDataSourcesListOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesList>>;
1175
+
1176
+ const result: ExternalDataSourcesListOutput = await posthog.externalDataSourcesList();
1177
+
1178
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; ...
1179
+ ```
1180
+
1181
+ ### `posthog.externalDataSourcesCreate`
1182
+
1183
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/`
1184
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1185
+ - **OpenAPI operationId**: `external_data_sources_create`
1186
+ - **Path params**: None
1187
+ - **Query params**: None
1188
+ - **Response codes**: `201`
1189
+ - **Transport options**: None
1190
+ - **TypeScript**: [Client interface](../types.ts)
1191
+
1192
+ **Inputs**
1193
+
1194
+ - Client input type: `{ [key: string]: unknown }`
1195
+ - Client transport options: None
1196
+
1197
+ **Outputs**
1198
+
1199
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
1200
+ - OpenAPI response codes: `201`
1201
+
1202
+ ```ts
1203
+ import posthog from "@utdk/posthog";
1204
+
1205
+ type ExternalDataSourcesCreateInput = Parameters<typeof posthog.externalDataSourcesCreate> extends [infer T, ...unknown[]] ? T : undefined;
1206
+ type ExternalDataSourcesCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesCreate>>;
1207
+
1208
+ const result: ExternalDataSourcesCreateOutput = await posthog.externalDataSourcesCreate();
1209
+
1210
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
1211
+ ```
1212
+
1213
+ ### `posthog.externalDataSourcesDestroy`
1214
+
1215
+ - **HTTP**: `DELETE /api/projects/{project_id}/external_data_sources/{id}/`
1216
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1217
+ - **OpenAPI operationId**: `external_data_sources_destroy`
1218
+ - **Path params**: `id`
1219
+ - **Query params**: None
1220
+ - **Response codes**: `204`
1221
+ - **Transport options**: None
1222
+ - **TypeScript**: [Client interface](../types.ts)
1223
+
1224
+ **Inputs**
1225
+
1226
+ - Client input type: `{ [key: string]: unknown }`
1227
+ - Client transport options: None
1228
+
1229
+ **Outputs**
1230
+
1231
+ - Client return type: `unknown`
1232
+ - OpenAPI response codes: `204`
1233
+
1234
+ ```ts
1235
+ import posthog from "@utdk/posthog";
1236
+
1237
+ type ExternalDataSourcesDestroyInput = Parameters<typeof posthog.externalDataSourcesDestroy> extends [infer T, ...unknown[]] ? T : undefined;
1238
+ type ExternalDataSourcesDestroyOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesDestroy>>;
1239
+
1240
+ const result: ExternalDataSourcesDestroyOutput = await posthog.externalDataSourcesDestroy();
1241
+
1242
+ // Result shape (from schema): unknown
1243
+ ```
1244
+
1245
+ ### `posthog.externalDataSourcesRetrieve`
1246
+
1247
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/{id}/`
1248
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1249
+ - **OpenAPI operationId**: `external_data_sources_retrieve`
1250
+ - **Path params**: `id`
1251
+ - **Query params**: None
1252
+ - **Response codes**: `200`
1253
+ - **Transport options**: None
1254
+ - **TypeScript**: [Client interface](../types.ts)
1255
+
1256
+ **Inputs**
1257
+
1258
+ - Client input type: `{ [key: string]: unknown }`
1259
+ - Client transport options: None
1260
+
1261
+ **Outputs**
1262
+
1263
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
1264
+ - OpenAPI response codes: `200`
1265
+
1266
+ ```ts
1267
+ import posthog from "@utdk/posthog";
1268
+
1269
+ type ExternalDataSourcesRetrieveInput = Parameters<typeof posthog.externalDataSourcesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1270
+ type ExternalDataSourcesRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesRetrieve>>;
1271
+
1272
+ const result: ExternalDataSourcesRetrieveOutput = await posthog.externalDataSourcesRetrieve();
1273
+
1274
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
1275
+ ```
1276
+
1277
+ ### `posthog.externalDataSourcesPartialUpdate`
1278
+
1279
+ - **HTTP**: `PATCH /api/projects/{project_id}/external_data_sources/{id}/`
1280
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1281
+ - **OpenAPI operationId**: `external_data_sources_partial_update`
1282
+ - **Path params**: `id`
1283
+ - **Query params**: None
1284
+ - **Response codes**: `200`
1285
+ - **Transport options**: None
1286
+ - **TypeScript**: [Client interface](../types.ts)
1287
+
1288
+ **Inputs**
1289
+
1290
+ - Client input type: `{ [key: string]: unknown }`
1291
+ - Client transport options: None
1292
+
1293
+ **Outputs**
1294
+
1295
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
1296
+ - OpenAPI response codes: `200`
1297
+
1298
+ ```ts
1299
+ import posthog from "@utdk/posthog";
1300
+
1301
+ type ExternalDataSourcesPartialUpdateInput = Parameters<typeof posthog.externalDataSourcesPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
1302
+ type ExternalDataSourcesPartialUpdateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesPartialUpdate>>;
1303
+
1304
+ const result: ExternalDataSourcesPartialUpdateOutput = await posthog.externalDataSourcesPartialUpdate();
1305
+
1306
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
1307
+ ```
1308
+
1309
+ ### `posthog.externalDataSourcesUpdate`
1310
+
1311
+ - **HTTP**: `PUT /api/projects/{project_id}/external_data_sources/{id}/`
1312
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1313
+ - **OpenAPI operationId**: `external_data_sources_update`
1314
+ - **Path params**: `id`
1315
+ - **Query params**: None
1316
+ - **Response codes**: `200`
1317
+ - **Transport options**: None
1318
+ - **TypeScript**: [Client interface](../types.ts)
1319
+
1320
+ **Inputs**
1321
+
1322
+ - Client input type: `{ [key: string]: unknown }`
1323
+ - Client transport options: None
1324
+
1325
+ **Outputs**
1326
+
1327
+ - Client return type: `{ id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...`
1328
+ - OpenAPI response codes: `200`
1329
+
1330
+ ```ts
1331
+ import posthog from "@utdk/posthog";
1332
+
1333
+ type ExternalDataSourcesUpdateInput = Parameters<typeof posthog.externalDataSourcesUpdate> extends [infer T, ...unknown[]] ? T : undefined;
1334
+ type ExternalDataSourcesUpdateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesUpdate>>;
1335
+
1336
+ const result: ExternalDataSourcesUpdateOutput = await posthog.externalDataSourcesUpdate();
1337
+
1338
+ // Result shape (from schema): { id: string; created_at: string; created_by: string | null; created_via?: "web" | "api" | "mcp" | null; status: string; client_secret: string; account_id: string; source_type: "Ashby" | "Supabase" | "CustomerIO" | "Git...
1339
+ ```
1340
+
1341
+ ### `posthog.externalDataSourcesBulkUpdateSchemasPartialUpdate`
1342
+
1343
+ - **HTTP**: `PATCH /api/projects/{project_id}/external_data_sources/{id}/bulk_update_schemas/`
1344
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1345
+ - **OpenAPI operationId**: `external_data_sources_bulk_update_schemas_partial_update`
1346
+ - **Path params**: `id`
1347
+ - **Query params**: `limit`, `offset`, `search`
1348
+ - **Response codes**: `200`
1349
+ - **Transport options**: None
1350
+ - **TypeScript**: [Client interface](../types.ts)
1351
+
1352
+ **Inputs**
1353
+
1354
+ - Client input type: `{ [key: string]: unknown }`
1355
+ - Client transport options: None
1356
+
1357
+ **Outputs**
1358
+
1359
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; label: string | null; table: { [key: string]: unknown } | null; should_sync?: boolean; last_synced_at: string | null...`
1360
+ - OpenAPI response codes: `200`
1361
+
1362
+ ```ts
1363
+ import posthog from "@utdk/posthog";
1364
+
1365
+ type ExternalDataSourcesBulkUpdateSchemasPartialUpdateInput = Parameters<typeof posthog.externalDataSourcesBulkUpdateSchemasPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
1366
+ type ExternalDataSourcesBulkUpdateSchemasPartialUpdateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesBulkUpdateSchemasPartialUpdate>>;
1367
+
1368
+ const result: ExternalDataSourcesBulkUpdateSchemasPartialUpdateOutput = await posthog.externalDataSourcesBulkUpdateSchemasPartialUpdate();
1369
+
1370
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; label: string | null; table: { [key: string]: unknown } | null; should_sync?: boolean; last_synced_at: string | null...
1371
+ ```
1372
+
1373
+ ### `posthog.externalDataSourcesCdcStatusRetrieve`
1374
+
1375
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/{id}/cdc_status/`
1376
+ - **What it does**: Live CDC health for an existing source: slot/publication existence and WAL lag.
1377
+
1378
+ Reads from the source DB via the engine adapter. Returns ``{"enabled": false}``
1379
+ when CDC is off, or the stored config plus live ``slot_exists`` /
1380
+ ``publication_exists`` / ``lag_bytes`` when on. 400s if the source DB is
1381
+ unreachable so the UI can show a degraded/unreachable state.
1382
+ - **OpenAPI operationId**: `external_data_sources_cdc_status_retrieve`
1383
+ - **Path params**: `id`
1384
+ - **Query params**: None
1385
+ - **Response codes**: `200`
1386
+ - **Transport options**: None
1387
+ - **TypeScript**: [Client interface](../types.ts)
1388
+
1389
+ **Inputs**
1390
+
1391
+ - Client input type: `{ [key: string]: unknown }`
1392
+ - Client transport options: None
1393
+
1394
+ **Outputs**
1395
+
1396
+ - Client return type: `unknown`
1397
+ - OpenAPI response codes: `200`
1398
+
1399
+ ```ts
1400
+ import posthog from "@utdk/posthog";
1401
+
1402
+ type ExternalDataSourcesCdcStatusRetrieveInput = Parameters<typeof posthog.externalDataSourcesCdcStatusRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1403
+ type ExternalDataSourcesCdcStatusRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesCdcStatusRetrieve>>;
1404
+
1405
+ const result: ExternalDataSourcesCdcStatusRetrieveOutput = await posthog.externalDataSourcesCdcStatusRetrieve();
1406
+
1407
+ // Result shape (from schema): unknown
1408
+ ```
1409
+
1410
+ ### `posthog.externalDataSourcesCheckCdcPrerequisitesForSourceCreate`
1411
+
1412
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/check_cdc_prerequisites_for_source/`
1413
+ - **What it does**: Validate CDC prerequisites for an existing source using its stored credentials.
1414
+
1415
+ The detail=False ``check_cdc_prerequisites`` action is for the creation wizard,
1416
+ where the client still holds the raw connection config (incl. password) in the
1417
+ form. On the Configuration page the source already exists and secret fields are
1418
+ stripped from API responses — so the client can't supply them. This reads the
1419
+ stored (encrypted) credentials from the DB via the adapter instead.
1420
+
1421
+ Body params: ``cdc_management_mode`` (``"posthog"`` | ``"self_managed"``),
1422
+ ``cdc_slot_name`` (optional), ``cdc_publication_name`` (optional).
1423
+ - **OpenAPI operationId**: `external_data_sources_check_cdc_prerequisites_for_source_create`
1424
+ - **Path params**: `id`
1425
+ - **Query params**: None
1426
+ - **Response codes**: `200`
1427
+ - **Transport options**: None
1428
+ - **TypeScript**: [Client interface](../types.ts)
1429
+
1430
+ **Inputs**
1431
+
1432
+ - Client input type: `{ [key: string]: unknown }`
1433
+ - Client transport options: None
1434
+
1435
+ **Outputs**
1436
+
1437
+ - Client return type: `unknown`
1438
+ - OpenAPI response codes: `200`
1439
+
1440
+ ```ts
1441
+ import posthog from "@utdk/posthog";
1442
+
1443
+ type ExternalDataSourcesCheckCdcPrerequisitesForSourceCreateInput = Parameters<typeof posthog.externalDataSourcesCheckCdcPrerequisitesForSourceCreate> extends [infer T, ...unknown[]] ? T : undefined;
1444
+ type ExternalDataSourcesCheckCdcPrerequisitesForSourceCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesCheckCdcPrerequisitesForSourceCreate>>;
1445
+
1446
+ const result: ExternalDataSourcesCheckCdcPrerequisitesForSourceCreateOutput = await posthog.externalDataSourcesCheckCdcPrerequisitesForSourceCreate();
1447
+
1448
+ // Result shape (from schema): unknown
1449
+ ```
1450
+
1451
+ ### `posthog.externalDataSourcesCreateWebhookCreate`
1452
+
1453
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/create_webhook/`
1454
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1455
+ - **OpenAPI operationId**: `external_data_sources_create_webhook_create`
1456
+ - **Path params**: `id`
1457
+ - **Query params**: None
1458
+ - **Response codes**: `200`
1459
+ - **Transport options**: None
1460
+ - **TypeScript**: [Client interface](../types.ts)
1461
+
1462
+ **Inputs**
1463
+
1464
+ - Client input type: `{ [key: string]: unknown }`
1465
+ - Client transport options: None
1466
+
1467
+ **Outputs**
1468
+
1469
+ - Client return type: `unknown`
1470
+ - OpenAPI response codes: `200`
1471
+
1472
+ ```ts
1473
+ import posthog from "@utdk/posthog";
1474
+
1475
+ type ExternalDataSourcesCreateWebhookCreateInput = Parameters<typeof posthog.externalDataSourcesCreateWebhookCreate> extends [infer T, ...unknown[]] ? T : undefined;
1476
+ type ExternalDataSourcesCreateWebhookCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesCreateWebhookCreate>>;
1477
+
1478
+ const result: ExternalDataSourcesCreateWebhookCreateOutput = await posthog.externalDataSourcesCreateWebhookCreate();
1479
+
1480
+ // Result shape (from schema): unknown
1481
+ ```
1482
+
1483
+ ### `posthog.externalDataSourcesDeleteWebhookCreate`
1484
+
1485
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/delete_webhook/`
1486
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1487
+ - **OpenAPI operationId**: `external_data_sources_delete_webhook_create`
1488
+ - **Path params**: `id`
1489
+ - **Query params**: None
1490
+ - **Response codes**: `200`
1491
+ - **Transport options**: None
1492
+ - **TypeScript**: [Client interface](../types.ts)
1493
+
1494
+ **Inputs**
1495
+
1496
+ - Client input type: `{ [key: string]: unknown }`
1497
+ - Client transport options: None
1498
+
1499
+ **Outputs**
1500
+
1501
+ - Client return type: `unknown`
1502
+ - OpenAPI response codes: `200`
1503
+
1504
+ ```ts
1505
+ import posthog from "@utdk/posthog";
1506
+
1507
+ type ExternalDataSourcesDeleteWebhookCreateInput = Parameters<typeof posthog.externalDataSourcesDeleteWebhookCreate> extends [infer T, ...unknown[]] ? T : undefined;
1508
+ type ExternalDataSourcesDeleteWebhookCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesDeleteWebhookCreate>>;
1509
+
1510
+ const result: ExternalDataSourcesDeleteWebhookCreateOutput = await posthog.externalDataSourcesDeleteWebhookCreate();
1511
+
1512
+ // Result shape (from schema): unknown
1513
+ ```
1514
+
1515
+ ### `posthog.externalDataSourcesDisableCdcCreate`
1516
+
1517
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/disable_cdc/`
1518
+ - **What it does**: Disable CDC on an existing source.
1519
+
1520
+ Cancels any running CDC extraction workflow, deletes the extraction schedule,
1521
+ delegates engine-side teardown to the source's adapter (drops slot/publication
1522
+ for Postgres; equivalent for other engines), clears ``cdc_*`` keys from
1523
+ ``job_inputs``, soft-deletes companion CDC tables, and sets all CDC schemas to
1524
+ ``sync_type=None``, ``should_sync=False`` so the user must pick a new sync
1525
+ strategy before they resume.
1526
+ - **OpenAPI operationId**: `external_data_sources_disable_cdc_create`
1527
+ - **Path params**: `id`
1528
+ - **Query params**: None
1529
+ - **Response codes**: `200`
1530
+ - **Transport options**: None
1531
+ - **TypeScript**: [Client interface](../types.ts)
1532
+
1533
+ **Inputs**
1534
+
1535
+ - Client input type: `{ [key: string]: unknown }`
1536
+ - Client transport options: None
1537
+
1538
+ **Outputs**
1539
+
1540
+ - Client return type: `unknown`
1541
+ - OpenAPI response codes: `200`
1542
+
1543
+ ```ts
1544
+ import posthog from "@utdk/posthog";
1545
+
1546
+ type ExternalDataSourcesDisableCdcCreateInput = Parameters<typeof posthog.externalDataSourcesDisableCdcCreate> extends [infer T, ...unknown[]] ? T : undefined;
1547
+ type ExternalDataSourcesDisableCdcCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesDisableCdcCreate>>;
1548
+
1549
+ const result: ExternalDataSourcesDisableCdcCreateOutput = await posthog.externalDataSourcesDisableCdcCreate();
1550
+
1551
+ // Result shape (from schema): unknown
1552
+ ```
1553
+
1554
+ ### `posthog.externalDataSourcesEnableCdcCreate`
1555
+
1556
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/enable_cdc/`
1557
+ - **What it does**: Enable CDC on an existing source.
1558
+
1559
+ Provisions engine-side CDC resources via the source's adapter, writes the CDC
1560
+ config into ``source.job_inputs``, and ensures the CDC extraction schedule
1561
+ exists. Re-runs prereq checks server-side so we never trust a stale
1562
+ client-side check.
1563
+
1564
+ Body params: ``cdc_management_mode`` (``"posthog"`` | ``"self_managed"``),
1565
+ plus engine-specific identifier hints (e.g. ``cdc_slot_name``,
1566
+ ``cdc_publication_name`` for Postgres). Universal tuning fields:
1567
+ ``cdc_auto_drop_slot`` (optional bool), ``cdc_lag_warning_threshold_mb``
1568
+ (optional int), ``cdc_lag_critical_threshold_mb`` (optional int).
1569
+ - **OpenAPI operationId**: `external_data_sources_enable_cdc_create`
1570
+ - **Path params**: `id`
1571
+ - **Query params**: None
1572
+ - **Response codes**: `200`
1573
+ - **Transport options**: None
1574
+ - **TypeScript**: [Client interface](../types.ts)
1575
+
1576
+ **Inputs**
1577
+
1578
+ - Client input type: `{ [key: string]: unknown }`
1579
+ - Client transport options: None
1580
+
1581
+ **Outputs**
1582
+
1583
+ - Client return type: `unknown`
1584
+ - OpenAPI response codes: `200`
1585
+
1586
+ ```ts
1587
+ import posthog from "@utdk/posthog";
1588
+
1589
+ type ExternalDataSourcesEnableCdcCreateInput = Parameters<typeof posthog.externalDataSourcesEnableCdcCreate> extends [infer T, ...unknown[]] ? T : undefined;
1590
+ type ExternalDataSourcesEnableCdcCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesEnableCdcCreate>>;
1591
+
1592
+ const result: ExternalDataSourcesEnableCdcCreateOutput = await posthog.externalDataSourcesEnableCdcCreate();
1593
+
1594
+ // Result shape (from schema): unknown
1595
+ ```
1596
+
1597
+ ### `posthog.externalDataSourcesJobsRetrieve`
1598
+
1599
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/{id}/jobs/`
1600
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1601
+ - **OpenAPI operationId**: `external_data_sources_jobs_retrieve`
1602
+ - **Path params**: `id`
1603
+ - **Query params**: None
1604
+ - **Response codes**: `200`
1605
+ - **Transport options**: None
1606
+ - **TypeScript**: [Client interface](../types.ts)
1607
+
1608
+ **Inputs**
1609
+
1610
+ - Client input type: `{ [key: string]: unknown }`
1611
+ - Client transport options: None
1612
+
1613
+ **Outputs**
1614
+
1615
+ - Client return type: `unknown`
1616
+ - OpenAPI response codes: `200`
1617
+
1618
+ ```ts
1619
+ import posthog from "@utdk/posthog";
1620
+
1621
+ type ExternalDataSourcesJobsRetrieveInput = Parameters<typeof posthog.externalDataSourcesJobsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1622
+ type ExternalDataSourcesJobsRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesJobsRetrieve>>;
1623
+
1624
+ const result: ExternalDataSourcesJobsRetrieveOutput = await posthog.externalDataSourcesJobsRetrieve();
1625
+
1626
+ // Result shape (from schema): unknown
1627
+ ```
1628
+
1629
+ ### `posthog.externalDataSourcesRefreshSchemasCreate`
1630
+
1631
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/refresh_schemas/`
1632
+ - **What it does**: Fetch current schema/table list from the source and create any new ExternalDataSchema rows (no data sync).
1633
+ - **OpenAPI operationId**: `external_data_sources_refresh_schemas_create`
1634
+ - **Path params**: `id`
1635
+ - **Query params**: None
1636
+ - **Response codes**: `200`
1637
+ - **Transport options**: None
1638
+ - **TypeScript**: [Client interface](../types.ts)
1639
+
1640
+ **Inputs**
1641
+
1642
+ - Client input type: `{ [key: string]: unknown }`
1643
+ - Client transport options: None
1644
+
1645
+ **Outputs**
1646
+
1647
+ - Client return type: `unknown`
1648
+ - OpenAPI response codes: `200`
1649
+
1650
+ ```ts
1651
+ import posthog from "@utdk/posthog";
1652
+
1653
+ type ExternalDataSourcesRefreshSchemasCreateInput = Parameters<typeof posthog.externalDataSourcesRefreshSchemasCreate> extends [infer T, ...unknown[]] ? T : undefined;
1654
+ type ExternalDataSourcesRefreshSchemasCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesRefreshSchemasCreate>>;
1655
+
1656
+ const result: ExternalDataSourcesRefreshSchemasCreateOutput = await posthog.externalDataSourcesRefreshSchemasCreate();
1657
+
1658
+ // Result shape (from schema): unknown
1659
+ ```
1660
+
1661
+ ### `posthog.externalDataSourcesReloadCreate`
1662
+
1663
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/reload/`
1664
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1665
+ - **OpenAPI operationId**: `external_data_sources_reload_create`
1666
+ - **Path params**: `id`
1667
+ - **Query params**: None
1668
+ - **Response codes**: `200`
1669
+ - **Transport options**: None
1670
+ - **TypeScript**: [Client interface](../types.ts)
1671
+
1672
+ **Inputs**
1673
+
1674
+ - Client input type: `{ [key: string]: unknown }`
1675
+ - Client transport options: None
1676
+
1677
+ **Outputs**
1678
+
1679
+ - Client return type: `unknown`
1680
+ - OpenAPI response codes: `200`
1681
+
1682
+ ```ts
1683
+ import posthog from "@utdk/posthog";
1684
+
1685
+ type ExternalDataSourcesReloadCreateInput = Parameters<typeof posthog.externalDataSourcesReloadCreate> extends [infer T, ...unknown[]] ? T : undefined;
1686
+ type ExternalDataSourcesReloadCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesReloadCreate>>;
1687
+
1688
+ const result: ExternalDataSourcesReloadCreateOutput = await posthog.externalDataSourcesReloadCreate();
1689
+
1690
+ // Result shape (from schema): unknown
1691
+ ```
1692
+
1693
+ ### `posthog.externalDataSourcesRepairCdcCreate`
1694
+
1695
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/repair_cdc/`
1696
+ - **What it does**: Repair CDC on a source whose replication resources were lost.
1697
+
1698
+ Only proceeds on evidence of breakage (a persisted broken marker, or a live probe
1699
+ showing the slot/publication missing) — repairing a healthy source would drop its
1700
+ slot and force a full re-sync. Cancels running CDC jobs, recreates the engine-side
1701
+ slot/publication against the stored CDC config, resets every active CDC schema to
1702
+ snapshot mode for a full re-sync (changes since the old slot died are
1703
+ unrecoverable), clears the broken markers, and resumes the paused schedules.
1704
+ Idempotent: safe to retry after a partial failure. Concurrent repairs of the same
1705
+ source are rejected with a 409.
1706
+ - **OpenAPI operationId**: `external_data_sources_repair_cdc_create`
1707
+ - **Path params**: `id`
1708
+ - **Query params**: None
1709
+ - **Response codes**: `200`, `400`, `409`
1710
+ - **Transport options**: None
1711
+ - **TypeScript**: [Client interface](../types.ts)
1712
+
1713
+ **Inputs**
1714
+
1715
+ - Client input type: `{ [key: string]: unknown }`
1716
+ - Client transport options: None
1717
+
1718
+ **Outputs**
1719
+
1720
+ - Client return type: `{ success?: boolean; schemas_reset?: number }`
1721
+ - OpenAPI response codes: `200`, `400`, `409`
1722
+
1723
+ ```ts
1724
+ import posthog from "@utdk/posthog";
1725
+
1726
+ type ExternalDataSourcesRepairCdcCreateInput = Parameters<typeof posthog.externalDataSourcesRepairCdcCreate> extends [infer T, ...unknown[]] ? T : undefined;
1727
+ type ExternalDataSourcesRepairCdcCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesRepairCdcCreate>>;
1728
+
1729
+ const result: ExternalDataSourcesRepairCdcCreateOutput = await posthog.externalDataSourcesRepairCdcCreate();
1730
+
1731
+ // Result shape (from schema): { success?: boolean; schemas_reset?: number }
1732
+ ```
1733
+
1734
+ ### `posthog.externalDataSourcesRevenueAnalyticsConfigPartialUpdate`
1735
+
1736
+ - **HTTP**: `PATCH /api/projects/{project_id}/external_data_sources/{id}/revenue_analytics_config/`
1737
+ - **What it does**: Update the revenue analytics configuration and return the full external data source.
1738
+ - **OpenAPI operationId**: `external_data_sources_revenue_analytics_config_partial_update`
1739
+ - **Path params**: `id`
1740
+ - **Query params**: None
1741
+ - **Response codes**: `200`
1742
+ - **Transport options**: None
1743
+ - **TypeScript**: [Client interface](../types.ts)
1744
+
1745
+ **Inputs**
1746
+
1747
+ - Client input type: `{ [key: string]: unknown }`
1748
+ - Client transport options: None
1749
+
1750
+ **Outputs**
1751
+
1752
+ - Client return type: `unknown`
1753
+ - OpenAPI response codes: `200`
1754
+
1755
+ ```ts
1756
+ import posthog from "@utdk/posthog";
1757
+
1758
+ type ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateInput = Parameters<typeof posthog.externalDataSourcesRevenueAnalyticsConfigPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
1759
+ type ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesRevenueAnalyticsConfigPartialUpdate>>;
1760
+
1761
+ const result: ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateOutput = await posthog.externalDataSourcesRevenueAnalyticsConfigPartialUpdate();
1762
+
1763
+ // Result shape (from schema): unknown
1764
+ ```
1765
+
1766
+ ### `posthog.externalDataSourcesUpdateCdcSettingsCreate`
1767
+
1768
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/update_cdc_settings/`
1769
+ - **What it does**: Update CDC tuning fields without enabling/disabling.
1770
+
1771
+ Lets users edit ``cdc_auto_drop_slot``, ``cdc_lag_warning_threshold_mb``, and
1772
+ ``cdc_lag_critical_threshold_mb`` independently. These fields are universal
1773
+ across engines. Engine-specific identifiers (slot name, management mode, …)
1774
+ are immutable post-enable — switching them requires disable + enable.
1775
+ - **OpenAPI operationId**: `external_data_sources_update_cdc_settings_create`
1776
+ - **Path params**: `id`
1777
+ - **Query params**: None
1778
+ - **Response codes**: `200`
1779
+ - **Transport options**: None
1780
+ - **TypeScript**: [Client interface](../types.ts)
1781
+
1782
+ **Inputs**
1783
+
1784
+ - Client input type: `{ [key: string]: unknown }`
1785
+ - Client transport options: None
1786
+
1787
+ **Outputs**
1788
+
1789
+ - Client return type: `unknown`
1790
+ - OpenAPI response codes: `200`
1791
+
1792
+ ```ts
1793
+ import posthog from "@utdk/posthog";
1794
+
1795
+ type ExternalDataSourcesUpdateCdcSettingsCreateInput = Parameters<typeof posthog.externalDataSourcesUpdateCdcSettingsCreate> extends [infer T, ...unknown[]] ? T : undefined;
1796
+ type ExternalDataSourcesUpdateCdcSettingsCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesUpdateCdcSettingsCreate>>;
1797
+
1798
+ const result: ExternalDataSourcesUpdateCdcSettingsCreateOutput = await posthog.externalDataSourcesUpdateCdcSettingsCreate();
1799
+
1800
+ // Result shape (from schema): unknown
1801
+ ```
1802
+
1803
+ ### `posthog.externalDataSourcesUpdateWebhookInputsCreate`
1804
+
1805
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/{id}/update_webhook_inputs/`
1806
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1807
+ - **OpenAPI operationId**: `external_data_sources_update_webhook_inputs_create`
1808
+ - **Path params**: `id`
1809
+ - **Query params**: None
1810
+ - **Response codes**: `200`
1811
+ - **Transport options**: None
1812
+ - **TypeScript**: [Client interface](../types.ts)
1813
+
1814
+ **Inputs**
1815
+
1816
+ - Client input type: `{ [key: string]: unknown }`
1817
+ - Client transport options: None
1818
+
1819
+ **Outputs**
1820
+
1821
+ - Client return type: `unknown`
1822
+ - OpenAPI response codes: `200`
1823
+
1824
+ ```ts
1825
+ import posthog from "@utdk/posthog";
1826
+
1827
+ type ExternalDataSourcesUpdateWebhookInputsCreateInput = Parameters<typeof posthog.externalDataSourcesUpdateWebhookInputsCreate> extends [infer T, ...unknown[]] ? T : undefined;
1828
+ type ExternalDataSourcesUpdateWebhookInputsCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesUpdateWebhookInputsCreate>>;
1829
+
1830
+ const result: ExternalDataSourcesUpdateWebhookInputsCreateOutput = await posthog.externalDataSourcesUpdateWebhookInputsCreate();
1831
+
1832
+ // Result shape (from schema): unknown
1833
+ ```
1834
+
1835
+ ### `posthog.externalDataSourcesWebhookInfoRetrieve`
1836
+
1837
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/{id}/webhook_info/`
1838
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1839
+ - **OpenAPI operationId**: `external_data_sources_webhook_info_retrieve`
1840
+ - **Path params**: `id`
1841
+ - **Query params**: None
1842
+ - **Response codes**: `200`
1843
+ - **Transport options**: None
1844
+ - **TypeScript**: [Client interface](../types.ts)
1845
+
1846
+ **Inputs**
1847
+
1848
+ - Client input type: `{ [key: string]: unknown }`
1849
+ - Client transport options: None
1850
+
1851
+ **Outputs**
1852
+
1853
+ - Client return type: `unknown`
1854
+ - OpenAPI response codes: `200`
1855
+
1856
+ ```ts
1857
+ import posthog from "@utdk/posthog";
1858
+
1859
+ type ExternalDataSourcesWebhookInfoRetrieveInput = Parameters<typeof posthog.externalDataSourcesWebhookInfoRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1860
+ type ExternalDataSourcesWebhookInfoRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesWebhookInfoRetrieve>>;
1861
+
1862
+ const result: ExternalDataSourcesWebhookInfoRetrieveOutput = await posthog.externalDataSourcesWebhookInfoRetrieve();
1863
+
1864
+ // Result shape (from schema): unknown
1865
+ ```
1866
+
1867
+ ### `posthog.externalDataSourcesCheckCdcPrerequisitesCreate`
1868
+
1869
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/check_cdc_prerequisites/`
1870
+ - **What it does**: Validate CDC prerequisites against a live Postgres connection.
1871
+
1872
+ Used by the source wizard to surface ✅/❌ checks before source creation,
1873
+ and by the self-managed setup popup to verify user-created publications.
1874
+ - **OpenAPI operationId**: `external_data_sources_check_cdc_prerequisites_create`
1875
+ - **Path params**: None
1876
+ - **Query params**: None
1877
+ - **Response codes**: `200`, `400`
1878
+ - **Transport options**: None
1879
+ - **TypeScript**: [Client interface](../types.ts)
1880
+
1881
+ **Inputs**
1882
+
1883
+ - Client input type: `{ [key: string]: unknown }`
1884
+ - Client transport options: None
1885
+
1886
+ **Outputs**
1887
+
1888
+ - Client return type: `{ valid?: boolean; errors?: (string)[] }`
1889
+ - OpenAPI response codes: `200`, `400`
1890
+
1891
+ ```ts
1892
+ import posthog from "@utdk/posthog";
1893
+
1894
+ type ExternalDataSourcesCheckCdcPrerequisitesCreateInput = Parameters<typeof posthog.externalDataSourcesCheckCdcPrerequisitesCreate> extends [infer T, ...unknown[]] ? T : undefined;
1895
+ type ExternalDataSourcesCheckCdcPrerequisitesCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesCheckCdcPrerequisitesCreate>>;
1896
+
1897
+ const result: ExternalDataSourcesCheckCdcPrerequisitesCreateOutput = await posthog.externalDataSourcesCheckCdcPrerequisitesCreate();
1898
+
1899
+ // Result shape (from schema): { valid?: boolean; errors?: (string)[] }
1900
+ ```
1901
+
1902
+ ### `posthog.externalDataSourcesConnectLinkRetrieve`
1903
+
1904
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/connect_link/`
1905
+ - **What it does**: Return a secure browser link for connecting a data warehouse source.
1906
+
1907
+ The link opens a minimal connect page rendering the source's full connection form — OAuth options
1908
+ included — with no table selection and no source creation. The user authenticates in their browser,
1909
+ secrets never pass through the agent, and the agent finishes setup afterwards by passing the stored
1910
+ credential id to data-warehouse-source-setup.
1911
+ - **OpenAPI operationId**: `external_data_sources_connect_link_retrieve`
1912
+ - **Path params**: None
1913
+ - **Query params**: `source_type`
1914
+ - **Response codes**: `200`
1915
+ - **Transport options**: None
1916
+ - **TypeScript**: [Client interface](../types.ts)
1917
+
1918
+ **Inputs**
1919
+
1920
+ - Client input type: `{ [key: string]: unknown }`
1921
+ - Client transport options: None
1922
+
1923
+ **Outputs**
1924
+
1925
+ - Client return type: `{ source_type: string; auth_method: "oauth" | "credentials"; connect_url: string; instructions: string }`
1926
+ - OpenAPI response codes: `200`
1927
+
1928
+ ```ts
1929
+ import posthog from "@utdk/posthog";
1930
+
1931
+ type ExternalDataSourcesConnectLinkRetrieveInput = Parameters<typeof posthog.externalDataSourcesConnectLinkRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1932
+ type ExternalDataSourcesConnectLinkRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesConnectLinkRetrieve>>;
1933
+
1934
+ const result: ExternalDataSourcesConnectLinkRetrieveOutput = await posthog.externalDataSourcesConnectLinkRetrieve();
1935
+
1936
+ // Result shape (from schema): { source_type: string; auth_method: "oauth" | "credentials"; connect_url: string; instructions: string }
1937
+ ```
1938
+
1939
+ ### `posthog.externalDataSourcesConnectionsList`
1940
+
1941
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/connections/`
1942
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1943
+ - **OpenAPI operationId**: `external_data_sources_connections_list`
1944
+ - **Path params**: None
1945
+ - **Query params**: `limit`, `offset`, `search`
1946
+ - **Response codes**: `200`
1947
+ - **Transport options**: None
1948
+ - **TypeScript**: [Client interface](../types.ts)
1949
+
1950
+ **Inputs**
1951
+
1952
+ - Client input type: `{ [key: string]: unknown }`
1953
+ - Client transport options: None
1954
+
1955
+ **Outputs**
1956
+
1957
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; prefix: string | null; engine: "duckdb" | "postgres" | "mysql" | "snowflake" | null })[] }`
1958
+ - OpenAPI response codes: `200`
1959
+
1960
+ ```ts
1961
+ import posthog from "@utdk/posthog";
1962
+
1963
+ type ExternalDataSourcesConnectionsListInput = Parameters<typeof posthog.externalDataSourcesConnectionsList> extends [infer T, ...unknown[]] ? T : undefined;
1964
+ type ExternalDataSourcesConnectionsListOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesConnectionsList>>;
1965
+
1966
+ const result: ExternalDataSourcesConnectionsListOutput = await posthog.externalDataSourcesConnectionsList();
1967
+
1968
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; prefix: string | null; engine: "duckdb" | "postgres" | "mysql" | "snowflake" | null })[] }
1969
+ ```
1970
+
1971
+ ### `posthog.externalDataSourcesDatabaseSchemaCreate`
1972
+
1973
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/database_schema/`
1974
+ - **What it does**: Create, Read, Update and Delete External data Sources.
1975
+ - **OpenAPI operationId**: `external_data_sources_database_schema_create`
1976
+ - **Path params**: None
1977
+ - **Query params**: None
1978
+ - **Response codes**: `200`
1979
+ - **Transport options**: None
1980
+ - **TypeScript**: [Client interface](../types.ts)
1981
+
1982
+ **Inputs**
1983
+
1984
+ - Client input type: `{ [key: string]: unknown }`
1985
+ - Client transport options: None
1986
+
1987
+ **Outputs**
1988
+
1989
+ - Client return type: `unknown`
1990
+ - OpenAPI response codes: `200`
1991
+
1992
+ ```ts
1993
+ import posthog from "@utdk/posthog";
1994
+
1995
+ type ExternalDataSourcesDatabaseSchemaCreateInput = Parameters<typeof posthog.externalDataSourcesDatabaseSchemaCreate> extends [infer T, ...unknown[]] ? T : undefined;
1996
+ type ExternalDataSourcesDatabaseSchemaCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesDatabaseSchemaCreate>>;
1997
+
1998
+ const result: ExternalDataSourcesDatabaseSchemaCreateOutput = await posthog.externalDataSourcesDatabaseSchemaCreate();
1999
+
2000
+ // Result shape (from schema): unknown
2001
+ ```
2002
+
2003
+ ### `posthog.externalDataSourcesDraftCustomManifestCreate`
2004
+
2005
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/draft_custom_manifest/`
2006
+ - **What it does**: Draft a Custom REST source manifest from API documentation using an LLM.
2007
+
2008
+ Reads the docs (a URL fetched server-side, or pasted text / OpenAPI spec), asks the model to
2009
+ author a RESTAPIConfig manifest, and validates it against the create-path checks — repairing
2010
+ against validation errors up to a small budget. Returns the manifest for the user to review
2011
+ and tweak in the builder before creating the source; it does NOT create anything. Gated by the
2012
+ `dwh-custom-source-ai-builder` flag, and requires the org to have approved AI data processing,
2013
+ since the docs are sent to the LLM gateway.
2014
+ - **OpenAPI operationId**: `external_data_sources_draft_custom_manifest_create`
2015
+ - **Path params**: None
2016
+ - **Query params**: None
2017
+ - **Response codes**: `200`
2018
+ - **Transport options**: None
2019
+ - **TypeScript**: [Client interface](../types.ts)
2020
+
2021
+ **Inputs**
2022
+
2023
+ - Client input type: `{ [key: string]: unknown }`
2024
+ - Client transport options: None
2025
+
2026
+ **Outputs**
2027
+
2028
+ - Client return type: `{ draft_status: "ok" | "invalid" | "model_error"; manifest_json: string | null; resource_names: (string)[]; attempts: number; error: string | null }`
2029
+ - OpenAPI response codes: `200`
2030
+
2031
+ ```ts
2032
+ import posthog from "@utdk/posthog";
2033
+
2034
+ type ExternalDataSourcesDraftCustomManifestCreateInput = Parameters<typeof posthog.externalDataSourcesDraftCustomManifestCreate> extends [infer T, ...unknown[]] ? T : undefined;
2035
+ type ExternalDataSourcesDraftCustomManifestCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesDraftCustomManifestCreate>>;
2036
+
2037
+ const result: ExternalDataSourcesDraftCustomManifestCreateOutput = await posthog.externalDataSourcesDraftCustomManifestCreate();
2038
+
2039
+ // Result shape (from schema): { draft_status: "ok" | "invalid" | "model_error"; manifest_json: string | null; resource_names: (string)[]; attempts: number; error: string | null }
2040
+ ```
2041
+
2042
+ ### `posthog.externalDataSourcesOauthAccountsRetrieve`
2043
+
2044
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/oauth_accounts/`
2045
+ - **What it does**: List the accounts/properties a connected OAuth integration exposes, in the shared
2046
+ IntegrationAccount shape. The logic lives in each source (via OAuthMixin.get_oauth_accounts);
2047
+ this endpoint just routes by source type and serializes the result.
2048
+ - **OpenAPI operationId**: `external_data_sources_oauth_accounts_retrieve`
2049
+ - **Path params**: None
2050
+ - **Query params**: `integration_id`, `source_type`
2051
+ - **Response codes**: `200`
2052
+ - **Transport options**: None
2053
+ - **TypeScript**: [Client interface](../types.ts)
2054
+
2055
+ **Inputs**
2056
+
2057
+ - Client input type: `{ [key: string]: unknown }`
2058
+ - Client transport options: None
2059
+
2060
+ **Outputs**
2061
+
2062
+ - Client return type: `{ accounts: ({ value: string; display_name: string; is_primary: boolean; badges: (string)[]; group: string | null; secondary_text: string | null })[] }`
2063
+ - OpenAPI response codes: `200`
2064
+
2065
+ ```ts
2066
+ import posthog from "@utdk/posthog";
2067
+
2068
+ type ExternalDataSourcesOauthAccountsRetrieveInput = Parameters<typeof posthog.externalDataSourcesOauthAccountsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
2069
+ type ExternalDataSourcesOauthAccountsRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesOauthAccountsRetrieve>>;
2070
+
2071
+ const result: ExternalDataSourcesOauthAccountsRetrieveOutput = await posthog.externalDataSourcesOauthAccountsRetrieve();
2072
+
2073
+ // Result shape (from schema): { accounts: ({ value: string; display_name: string; is_primary: boolean; badges: (string)[]; group: string | null; secondary_text: string | null })[] }
2074
+ ```
2075
+
2076
+ ### `posthog.externalDataSourcesPreviewResourceCreate`
2077
+
2078
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/preview_resource/`
2079
+ - **What it does**: Read a bounded sample of rows for one resource of a Custom REST source.
2080
+
2081
+ Lets a manifest author verify `data_selector`, `primary_key`, and the incremental
2082
+ `cursor_path` against live data before creating the source. Only `source_type: "Custom"`
2083
+ is supported — other source types return 400. The read is bounded (single page per
2084
+ resource, capped row count, short timeouts, no redirects). Manifest, validation, and SSRF
2085
+ problems return 400; a live fetch failure returns 200 with `error` set and empty `rows`.
2086
+ - **OpenAPI operationId**: `external_data_sources_preview_resource_create`
2087
+ - **Path params**: None
2088
+ - **Query params**: None
2089
+ - **Response codes**: `200`
2090
+ - **Transport options**: None
2091
+ - **TypeScript**: [Client interface](../types.ts)
2092
+
2093
+ **Inputs**
2094
+
2095
+ - Client input type: `{ [key: string]: unknown }`
2096
+ - Client transport options: None
2097
+
2098
+ **Outputs**
2099
+
2100
+ - Client return type: `{ rows: ({ [key: string]: unknown })[]; row_count: number; columns: ({ name: string; type: string })[]; error: string | null }`
2101
+ - OpenAPI response codes: `200`
2102
+
2103
+ ```ts
2104
+ import posthog from "@utdk/posthog";
2105
+
2106
+ type ExternalDataSourcesPreviewResourceCreateInput = Parameters<typeof posthog.externalDataSourcesPreviewResourceCreate> extends [infer T, ...unknown[]] ? T : undefined;
2107
+ type ExternalDataSourcesPreviewResourceCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesPreviewResourceCreate>>;
2108
+
2109
+ const result: ExternalDataSourcesPreviewResourceCreateOutput = await posthog.externalDataSourcesPreviewResourceCreate();
2110
+
2111
+ // Result shape (from schema): { rows: ({ [key: string]: unknown })[]; row_count: number; columns: ({ name: string; type: string })[]; error: string | null }
2112
+ ```
2113
+
2114
+ ### `posthog.externalDataSourcesSetupCreate`
2115
+
2116
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/setup/`
2117
+ - **What it does**: One-shot data warehouse source setup.
2118
+
2119
+ Validate credentials, discover available tables, enable them all with sensible sync defaults
2120
+ (incremental where supported, else append, else full refresh), and create the source in a single
2121
+ call — the caller never has to assemble a `schemas` array. For sources that support webhooks
2122
+ (e.g. Stripe), a webhook is auto-registered after creation: on success webhook-capable tables
2123
+ switch to real-time webhook sync (unlocking webhook-only tables); on failure the polling
2124
+ defaults stay in place. For fine-grained table/sync control, use the lower-level
2125
+ `database_schema` + `create` flow instead.
2126
+ - **OpenAPI operationId**: `external_data_sources_setup_create`
2127
+ - **Path params**: None
2128
+ - **Query params**: None
2129
+ - **Response codes**: `201`
2130
+ - **Transport options**: None
2131
+ - **TypeScript**: [Client interface](../types.ts)
2132
+
2133
+ **Inputs**
2134
+
2135
+ - Client input type: `{ [key: string]: unknown }`
2136
+ - Client transport options: None
2137
+
2138
+ **Outputs**
2139
+
2140
+ - Client return type: `{ id: string; webhook?: { success: boolean; webhook_url: string | null; error: string | null; pending_inputs: (string)[] } }`
2141
+ - OpenAPI response codes: `201`
2142
+
2143
+ ```ts
2144
+ import posthog from "@utdk/posthog";
2145
+
2146
+ type ExternalDataSourcesSetupCreateInput = Parameters<typeof posthog.externalDataSourcesSetupCreate> extends [infer T, ...unknown[]] ? T : undefined;
2147
+ type ExternalDataSourcesSetupCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesSetupCreate>>;
2148
+
2149
+ const result: ExternalDataSourcesSetupCreateOutput = await posthog.externalDataSourcesSetupCreate();
2150
+
2151
+ // Result shape (from schema): { id: string; webhook?: { success: boolean; webhook_url: string | null; error: string | null; pending_inputs: (string)[] } }
2152
+ ```
2153
+
2154
+ ### `posthog.externalDataSourcesSourcePrefixCreate`
2155
+
2156
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/source_prefix/`
2157
+ - **What it does**: Create, Read, Update and Delete External data Sources.
2158
+ - **OpenAPI operationId**: `external_data_sources_source_prefix_create`
2159
+ - **Path params**: None
2160
+ - **Query params**: None
2161
+ - **Response codes**: `200`
2162
+ - **Transport options**: None
2163
+ - **TypeScript**: [Client interface](../types.ts)
2164
+
2165
+ **Inputs**
2166
+
2167
+ - Client input type: `{ [key: string]: unknown }`
2168
+ - Client transport options: None
2169
+
2170
+ **Outputs**
2171
+
2172
+ - Client return type: `unknown`
2173
+ - OpenAPI response codes: `200`
2174
+
2175
+ ```ts
2176
+ import posthog from "@utdk/posthog";
2177
+
2178
+ type ExternalDataSourcesSourcePrefixCreateInput = Parameters<typeof posthog.externalDataSourcesSourcePrefixCreate> extends [infer T, ...unknown[]] ? T : undefined;
2179
+ type ExternalDataSourcesSourcePrefixCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesSourcePrefixCreate>>;
2180
+
2181
+ const result: ExternalDataSourcesSourcePrefixCreateOutput = await posthog.externalDataSourcesSourcePrefixCreate();
2182
+
2183
+ // Result shape (from schema): unknown
2184
+ ```
2185
+
2186
+ ### `posthog.externalDataSourcesStoreCredentialsCreate`
2187
+
2188
+ - **HTTP**: `POST /api/projects/{project_id}/external_data_sources/store_credentials/`
2189
+ - **What it does**: Validate and store credentials for a data warehouse source without creating the source.
2190
+
2191
+ Backs the source connect page: the user enters credentials directly in PostHog, they are
2192
+ checked against a live connection, then stashed encrypted in a temporary store. The returned
2193
+ credential id can be passed to `setup` as {'credential_id': <id>} to create the source — so
2194
+ secrets never travel through an agent conversation. The stash is single-use: it is deleted
2195
+ as soon as `setup` consumes it, and expires after 24 hours if never consumed.
2196
+ - **OpenAPI operationId**: `external_data_sources_store_credentials_create`
2197
+ - **Path params**: None
2198
+ - **Query params**: None
2199
+ - **Response codes**: `201`
2200
+ - **Transport options**: None
2201
+ - **TypeScript**: [Client interface](../types.ts)
2202
+
2203
+ **Inputs**
2204
+
2205
+ - Client input type: `{ [key: string]: unknown }`
2206
+ - Client transport options: None
2207
+
2208
+ **Outputs**
2209
+
2210
+ - Client return type: `{ credential_id: string; source_type: string; created_at: string; expires_at: string }`
2211
+ - OpenAPI response codes: `201`
2212
+
2213
+ ```ts
2214
+ import posthog from "@utdk/posthog";
2215
+
2216
+ type ExternalDataSourcesStoreCredentialsCreateInput = Parameters<typeof posthog.externalDataSourcesStoreCredentialsCreate> extends [infer T, ...unknown[]] ? T : undefined;
2217
+ type ExternalDataSourcesStoreCredentialsCreateOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesStoreCredentialsCreate>>;
2218
+
2219
+ const result: ExternalDataSourcesStoreCredentialsCreateOutput = await posthog.externalDataSourcesStoreCredentialsCreate();
2220
+
2221
+ // Result shape (from schema): { credential_id: string; source_type: string; created_at: string; expires_at: string }
2222
+ ```
2223
+
2224
+ ### `posthog.externalDataSourcesStoredCredentialsList`
2225
+
2226
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/stored_credentials/`
2227
+ - **What it does**: List credentials stored via the source connect page that haven't been consumed yet.
2228
+
2229
+ Returns metadata only (id, source type, timestamps) — never the secrets themselves. Stored
2230
+ credentials are temporary: they disappear once consumed by `setup` or when they expire.
2231
+ Newest first, so after a user confirms they've finished the connect page, the first entry
2232
+ for the source type is the one to pass to `setup`.
2233
+ - **OpenAPI operationId**: `external_data_sources_stored_credentials_list`
2234
+ - **Path params**: None
2235
+ - **Query params**: `search`, `source_type`
2236
+ - **Response codes**: `200`
2237
+ - **Transport options**: None
2238
+ - **TypeScript**: [Client interface](../types.ts)
2239
+
2240
+ **Inputs**
2241
+
2242
+ - Client input type: `{ [key: string]: unknown }`
2243
+ - Client transport options: None
2244
+
2245
+ **Outputs**
2246
+
2247
+ - Client return type: `({ credential_id: string; source_type: string; created_at: string; expires_at: string })[]`
2248
+ - OpenAPI response codes: `200`
2249
+
2250
+ ```ts
2251
+ import posthog from "@utdk/posthog";
2252
+
2253
+ type ExternalDataSourcesStoredCredentialsListInput = Parameters<typeof posthog.externalDataSourcesStoredCredentialsList> extends [infer T, ...unknown[]] ? T : undefined;
2254
+ type ExternalDataSourcesStoredCredentialsListOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesStoredCredentialsList>>;
2255
+
2256
+ const result: ExternalDataSourcesStoredCredentialsListOutput = await posthog.externalDataSourcesStoredCredentialsList();
2257
+
2258
+ // Result shape (from schema): ({ credential_id: string; source_type: string; created_at: string; expires_at: string })[]
2259
+ ```
2260
+
2261
+ ### `posthog.externalDataSourcesWizardRetrieve`
2262
+
2263
+ - **HTTP**: `GET /api/projects/{project_id}/external_data_sources/wizard/`
2264
+ - **What it does**: Create, Read, Update and Delete External data Sources.
2265
+ - **OpenAPI operationId**: `external_data_sources_wizard_retrieve`
2266
+ - **Path params**: None
2267
+ - **Query params**: `source_type`
2268
+ - **Response codes**: `200`
2269
+ - **Transport options**: None
2270
+ - **TypeScript**: [Client interface](../types.ts)
2271
+
2272
+ **Inputs**
2273
+
2274
+ - Client input type: `{ [key: string]: unknown }`
2275
+ - Client transport options: None
2276
+
2277
+ **Outputs**
2278
+
2279
+ - Client return type: `unknown`
2280
+ - OpenAPI response codes: `200`
2281
+
2282
+ ```ts
2283
+ import posthog from "@utdk/posthog";
2284
+
2285
+ type ExternalDataSourcesWizardRetrieveInput = Parameters<typeof posthog.externalDataSourcesWizardRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
2286
+ type ExternalDataSourcesWizardRetrieveOutput = Awaited<ReturnType<typeof posthog.externalDataSourcesWizardRetrieve>>;
2287
+
2288
+ const result: ExternalDataSourcesWizardRetrieveOutput = await posthog.externalDataSourcesWizardRetrieve();
2289
+
2290
+ // Result shape (from schema): unknown
2291
+ ```
2292
+
2293
+
2294
+ <!-- prompt-hash:
2295
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
2296
+ -->