@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,1030 @@
1
+ # Endpoints
2
+
3
+ ## Operations
4
+
5
+ ### `posthog.environmentsEndpointsList`
6
+
7
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/`
8
+ - **What it does**: List all endpoints for the team.
9
+ - **OpenAPI operationId**: `environments_endpoints_list`
10
+ - **Path params**: None
11
+ - **Query params**: `created_by`, `is_active`, `limit`, `offset`
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; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...`
24
+ - OpenAPI response codes: `200`
25
+
26
+ ```ts
27
+ import posthog from "@utdk/posthog";
28
+
29
+ type EnvironmentsEndpointsListInput = Parameters<typeof posthog.environmentsEndpointsList> extends [infer T, ...unknown[]] ? T : undefined;
30
+ type EnvironmentsEndpointsListOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsList>>;
31
+
32
+ const result: EnvironmentsEndpointsListOutput = await posthog.environmentsEndpointsList();
33
+
34
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...
35
+ ```
36
+
37
+ ### `posthog.environmentsEndpointsCreate`
38
+
39
+ - **HTTP**: `POST /api/environments/{environment_id}/endpoints/`
40
+ - **What it does**: Create a new endpoint.
41
+ - **OpenAPI operationId**: `environments_endpoints_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; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
56
+ - OpenAPI response codes: `201`
57
+
58
+ ```ts
59
+ import posthog from "@utdk/posthog";
60
+
61
+ type EnvironmentsEndpointsCreateInput = Parameters<typeof posthog.environmentsEndpointsCreate> extends [infer T, ...unknown[]] ? T : undefined;
62
+ type EnvironmentsEndpointsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsCreate>>;
63
+
64
+ const result: EnvironmentsEndpointsCreateOutput = await posthog.environmentsEndpointsCreate();
65
+
66
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
67
+ ```
68
+
69
+ ### `posthog.environmentsEndpointsDestroy`
70
+
71
+ - **HTTP**: `DELETE /api/environments/{environment_id}/endpoints/{name}/`
72
+ - **What it does**: Delete an endpoint and clean up materialized query.
73
+ - **OpenAPI operationId**: `environments_endpoints_destroy`
74
+ - **Path params**: `name`
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 EnvironmentsEndpointsDestroyInput = Parameters<typeof posthog.environmentsEndpointsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
94
+ type EnvironmentsEndpointsDestroyOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsDestroy>>;
95
+
96
+ const result: EnvironmentsEndpointsDestroyOutput = await posthog.environmentsEndpointsDestroy();
97
+
98
+ // Result shape (from schema): unknown
99
+ ```
100
+
101
+ ### `posthog.environmentsEndpointsRetrieve`
102
+
103
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/{name}/`
104
+ - **What it does**: Retrieve an endpoint, or a specific version via ?version=N.
105
+ - **OpenAPI operationId**: `environments_endpoints_retrieve`
106
+ - **Path params**: `name`
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; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
120
+ - OpenAPI response codes: `200`
121
+
122
+ ```ts
123
+ import posthog from "@utdk/posthog";
124
+
125
+ type EnvironmentsEndpointsRetrieveInput = Parameters<typeof posthog.environmentsEndpointsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
126
+ type EnvironmentsEndpointsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsRetrieve>>;
127
+
128
+ const result: EnvironmentsEndpointsRetrieveOutput = await posthog.environmentsEndpointsRetrieve();
129
+
130
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
131
+ ```
132
+
133
+ ### `posthog.environmentsEndpointsPartialUpdate`
134
+
135
+ - **HTTP**: `PATCH /api/environments/{environment_id}/endpoints/{name}/`
136
+ - **What it does**: Update an existing endpoint.
137
+ - **OpenAPI operationId**: `environments_endpoints_partial_update`
138
+ - **Path params**: `name`
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; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
152
+ - OpenAPI response codes: `200`
153
+
154
+ ```ts
155
+ import posthog from "@utdk/posthog";
156
+
157
+ type EnvironmentsEndpointsPartialUpdateInput = Parameters<typeof posthog.environmentsEndpointsPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
158
+ type EnvironmentsEndpointsPartialUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsPartialUpdate>>;
159
+
160
+ const result: EnvironmentsEndpointsPartialUpdateOutput = await posthog.environmentsEndpointsPartialUpdate();
161
+
162
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
163
+ ```
164
+
165
+ ### `posthog.environmentsEndpointsUpdate`
166
+
167
+ - **HTTP**: `PUT /api/environments/{environment_id}/endpoints/{name}/`
168
+ - **What it does**: Update an existing endpoint. Parameters are optional. Pass version in body or ?version=N query param to target a specific version.
169
+ - **OpenAPI operationId**: `environments_endpoints_update`
170
+ - **Path params**: `name`
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; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
184
+ - OpenAPI response codes: `200`
185
+
186
+ ```ts
187
+ import posthog from "@utdk/posthog";
188
+
189
+ type EnvironmentsEndpointsUpdateInput = Parameters<typeof posthog.environmentsEndpointsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
190
+ type EnvironmentsEndpointsUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsUpdate>>;
191
+
192
+ const result: EnvironmentsEndpointsUpdateOutput = await posthog.environmentsEndpointsUpdate();
193
+
194
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
195
+ ```
196
+
197
+ ### `posthog.environmentsEndpointsLogsRetrieve`
198
+
199
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/{name}/logs/`
200
+ - **OpenAPI operationId**: `environments_endpoints_logs_retrieve`
201
+ - **Path params**: `name`
202
+ - **Query params**: `after`, `before`, `instance_id`, `level`, `limit`, `search`
203
+ - **Response codes**: `200`
204
+ - **Transport options**: None
205
+ - **TypeScript**: [Client interface](../types.ts)
206
+
207
+ **Inputs**
208
+
209
+ - Client input type: `{ [key: string]: unknown }`
210
+ - Client transport options: None
211
+
212
+ **Outputs**
213
+
214
+ - Client return type: `unknown`
215
+ - OpenAPI response codes: `200`
216
+
217
+ ```ts
218
+ import posthog from "@utdk/posthog";
219
+
220
+ type EnvironmentsEndpointsLogsRetrieveInput = Parameters<typeof posthog.environmentsEndpointsLogsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
221
+ type EnvironmentsEndpointsLogsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsLogsRetrieve>>;
222
+
223
+ const result: EnvironmentsEndpointsLogsRetrieveOutput = await posthog.environmentsEndpointsLogsRetrieve();
224
+
225
+ // Result shape (from schema): unknown
226
+ ```
227
+
228
+ ### `posthog.environmentsEndpointsMaterializationPreviewCreate`
229
+
230
+ - **HTTP**: `POST /api/environments/{environment_id}/endpoints/{name}/materialization_preview/`
231
+ - **What it does**: Preview the materialization transform for an endpoint. Shows what the query will look like after materialization, including range pair detection and bucket functions.
232
+ - **OpenAPI operationId**: `environments_endpoints_materialization_preview_create`
233
+ - **Path params**: `name`
234
+ - **Query params**: None
235
+ - **Response codes**: `200`
236
+ - **Transport options**: None
237
+ - **TypeScript**: [Client interface](../types.ts)
238
+
239
+ **Inputs**
240
+
241
+ - Client input type: `{ [key: string]: unknown }`
242
+ - Client transport options: None
243
+
244
+ **Outputs**
245
+
246
+ - Client return type: `unknown`
247
+ - OpenAPI response codes: `200`
248
+
249
+ ```ts
250
+ import posthog from "@utdk/posthog";
251
+
252
+ type EnvironmentsEndpointsMaterializationPreviewCreateInput = Parameters<typeof posthog.environmentsEndpointsMaterializationPreviewCreate> extends [infer T, ...unknown[]] ? T : undefined;
253
+ type EnvironmentsEndpointsMaterializationPreviewCreateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsMaterializationPreviewCreate>>;
254
+
255
+ const result: EnvironmentsEndpointsMaterializationPreviewCreateOutput = await posthog.environmentsEndpointsMaterializationPreviewCreate();
256
+
257
+ // Result shape (from schema): unknown
258
+ ```
259
+
260
+ ### `posthog.environmentsEndpointsMaterializationStatusRetrieve`
261
+
262
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/{name}/materialization_status/`
263
+ - **What it does**: Get materialization status for an endpoint. Supports ?version=N query param.
264
+ - **OpenAPI operationId**: `environments_endpoints_materialization_status_retrieve`
265
+ - **Path params**: `name`
266
+ - **Query params**: None
267
+ - **Response codes**: `200`
268
+ - **Transport options**: None
269
+ - **TypeScript**: [Client interface](../types.ts)
270
+
271
+ **Inputs**
272
+
273
+ - Client input type: `{ [key: string]: unknown }`
274
+ - Client transport options: None
275
+
276
+ **Outputs**
277
+
278
+ - Client return type: `{ name: string; status?: string; can_materialize: boolean; reason?: string | null; last_materialized_at?: string | null; error?: string; saved_query_id?: string | null }`
279
+ - OpenAPI response codes: `200`
280
+
281
+ ```ts
282
+ import posthog from "@utdk/posthog";
283
+
284
+ type EnvironmentsEndpointsMaterializationStatusRetrieveInput = Parameters<typeof posthog.environmentsEndpointsMaterializationStatusRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
285
+ type EnvironmentsEndpointsMaterializationStatusRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsMaterializationStatusRetrieve>>;
286
+
287
+ const result: EnvironmentsEndpointsMaterializationStatusRetrieveOutput = await posthog.environmentsEndpointsMaterializationStatusRetrieve();
288
+
289
+ // Result shape (from schema): { name: string; status?: string; can_materialize: boolean; reason?: string | null; last_materialized_at?: string | null; error?: string; saved_query_id?: string | null }
290
+ ```
291
+
292
+ ### `posthog.environmentsEndpointsMaterializationSuggestionCreate`
293
+
294
+ - **HTTP**: `POST /api/environments/{environment_id}/endpoints/{name}/materialization_suggestion/`
295
+ - **What it does**: Ask AI to rewrite the endpoint's query into a semantically equivalent form that can be materialized. Only applicable to SQL (HogQL) endpoints that currently fail the materialization checks. The suggestion is validated against the live checks before being returned; nothing is saved. Requires the organization's AI data processing approval.
296
+ - **OpenAPI operationId**: `environments_endpoints_materialization_suggestion_create`
297
+ - **Path params**: `name`
298
+ - **Query params**: None
299
+ - **Response codes**: `200`
300
+ - **Transport options**: None
301
+ - **TypeScript**: [Client interface](../types.ts)
302
+
303
+ **Inputs**
304
+
305
+ - Client input type: `{ [key: string]: unknown }`
306
+ - Client transport options: None
307
+
308
+ **Outputs**
309
+
310
+ - Client return type: `{ suggestion_status: "ok" | "cannot_fix" | "invalid" | "model_error"; suggested_query: string | null; explanation: string | null; attempts: number; error: string | null; original_reason: string }`
311
+ - OpenAPI response codes: `200`
312
+
313
+ ```ts
314
+ import posthog from "@utdk/posthog";
315
+
316
+ type EnvironmentsEndpointsMaterializationSuggestionCreateInput = Parameters<typeof posthog.environmentsEndpointsMaterializationSuggestionCreate> extends [infer T, ...unknown[]] ? T : undefined;
317
+ type EnvironmentsEndpointsMaterializationSuggestionCreateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsMaterializationSuggestionCreate>>;
318
+
319
+ const result: EnvironmentsEndpointsMaterializationSuggestionCreateOutput = await posthog.environmentsEndpointsMaterializationSuggestionCreate();
320
+
321
+ // Result shape (from schema): { suggestion_status: "ok" | "cannot_fix" | "invalid" | "model_error"; suggested_query: string | null; explanation: string | null; attempts: number; error: string | null; original_reason: string }
322
+ ```
323
+
324
+ ### `posthog.environmentsEndpointsOpenapiSpecRetrieve`
325
+
326
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/{name}/openapi.json/`
327
+ - **What it does**: Get OpenAPI 3.0 specification for this endpoint. Use this to generate typed SDK clients.
328
+ - **OpenAPI operationId**: `environments_endpoints_openapi_spec_retrieve`
329
+ - **Path params**: `name`
330
+ - **Query params**: `version`
331
+ - **Response codes**: `200`
332
+ - **Transport options**: None
333
+ - **TypeScript**: [Client interface](../types.ts)
334
+
335
+ **Inputs**
336
+
337
+ - Client input type: `{ [key: string]: unknown }`
338
+ - Client transport options: None
339
+
340
+ **Outputs**
341
+
342
+ - Client return type: `unknown`
343
+ - OpenAPI response codes: `200`
344
+
345
+ ```ts
346
+ import posthog from "@utdk/posthog";
347
+
348
+ type EnvironmentsEndpointsOpenapiSpecRetrieveInput = Parameters<typeof posthog.environmentsEndpointsOpenapiSpecRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
349
+ type EnvironmentsEndpointsOpenapiSpecRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsOpenapiSpecRetrieve>>;
350
+
351
+ const result: EnvironmentsEndpointsOpenapiSpecRetrieveOutput = await posthog.environmentsEndpointsOpenapiSpecRetrieve();
352
+
353
+ // Result shape (from schema): unknown
354
+ ```
355
+
356
+ ### `posthog.environmentsEndpointsRunRetrieve`
357
+
358
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/{name}/run/`
359
+ - **What it does**: Execute endpoint with optional materialization. Supports version parameter, runs latest version if not set.
360
+ - **OpenAPI operationId**: `environments_endpoints_run_retrieve`
361
+ - **Path params**: `name`
362
+ - **Query params**: None
363
+ - **Response codes**: `200`
364
+ - **Transport options**: None
365
+ - **TypeScript**: [Client interface](../types.ts)
366
+
367
+ **Inputs**
368
+
369
+ - Client input type: `{ [key: string]: unknown }`
370
+ - Client transport options: None
371
+
372
+ **Outputs**
373
+
374
+ - Client return type: `{ name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }`
375
+ - OpenAPI response codes: `200`
376
+
377
+ ```ts
378
+ import posthog from "@utdk/posthog";
379
+
380
+ type EnvironmentsEndpointsRunRetrieveInput = Parameters<typeof posthog.environmentsEndpointsRunRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
381
+ type EnvironmentsEndpointsRunRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsRunRetrieve>>;
382
+
383
+ const result: EnvironmentsEndpointsRunRetrieveOutput = await posthog.environmentsEndpointsRunRetrieve();
384
+
385
+ // Result shape (from schema): { name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }
386
+ ```
387
+
388
+ ### `posthog.environmentsEndpointsRunCreate`
389
+
390
+ - **HTTP**: `POST /api/environments/{environment_id}/endpoints/{name}/run/`
391
+ - **What it does**: Execute endpoint with optional materialization. Supports version parameter, runs latest version if not set.
392
+ - **OpenAPI operationId**: `environments_endpoints_run_create`
393
+ - **Path params**: `name`
394
+ - **Query params**: None
395
+ - **Response codes**: `200`
396
+ - **Transport options**: None
397
+ - **TypeScript**: [Client interface](../types.ts)
398
+
399
+ **Inputs**
400
+
401
+ - Client input type: `{ [key: string]: unknown }`
402
+ - Client transport options: None
403
+
404
+ **Outputs**
405
+
406
+ - Client return type: `{ name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }`
407
+ - OpenAPI response codes: `200`
408
+
409
+ ```ts
410
+ import posthog from "@utdk/posthog";
411
+
412
+ type EnvironmentsEndpointsRunCreateInput = Parameters<typeof posthog.environmentsEndpointsRunCreate> extends [infer T, ...unknown[]] ? T : undefined;
413
+ type EnvironmentsEndpointsRunCreateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsRunCreate>>;
414
+
415
+ const result: EnvironmentsEndpointsRunCreateOutput = await posthog.environmentsEndpointsRunCreate();
416
+
417
+ // Result shape (from schema): { name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }
418
+ ```
419
+
420
+ ### `posthog.environmentsEndpointsVersionsList`
421
+
422
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/{name}/versions/`
423
+ - **What it does**: List all versions for an endpoint.
424
+ - **OpenAPI operationId**: `environments_endpoints_versions_list`
425
+ - **Path params**: `name`
426
+ - **Query params**: `created_by`, `is_active`, `limit`, `offset`
427
+ - **Response codes**: `200`
428
+ - **Transport options**: None
429
+ - **TypeScript**: [Client interface](../types.ts)
430
+
431
+ **Inputs**
432
+
433
+ - Client input type: `{ [key: string]: unknown }`
434
+ - Client transport options: None
435
+
436
+ **Outputs**
437
+
438
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...`
439
+ - OpenAPI response codes: `200`
440
+
441
+ ```ts
442
+ import posthog from "@utdk/posthog";
443
+
444
+ type EnvironmentsEndpointsVersionsListInput = Parameters<typeof posthog.environmentsEndpointsVersionsList> extends [infer T, ...unknown[]] ? T : undefined;
445
+ type EnvironmentsEndpointsVersionsListOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsVersionsList>>;
446
+
447
+ const result: EnvironmentsEndpointsVersionsListOutput = await posthog.environmentsEndpointsVersionsList();
448
+
449
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...
450
+ ```
451
+
452
+ ### `posthog.environmentsEndpointsLastExecutionTimesCreate`
453
+
454
+ - **HTTP**: `POST /api/environments/{environment_id}/endpoints/last_execution_times/`
455
+ - **What it does**: Get the most recent execution time per endpoint (endpoint-level). Timestamps are recorded by the run path for personal-API-key calls. For per-version usage, query the query_log table directly.
456
+ - **OpenAPI operationId**: `environments_endpoints_last_execution_times_create`
457
+ - **Path params**: None
458
+ - **Query params**: None
459
+ - **Response codes**: `200`
460
+ - **Transport options**: None
461
+ - **TypeScript**: [Client interface](../types.ts)
462
+
463
+ **Inputs**
464
+
465
+ - Client input type: `{ [key: string]: unknown }`
466
+ - Client transport options: None
467
+
468
+ **Outputs**
469
+
470
+ - Client return type: `{ query_status: { complete?: boolean | null; dashboard_id?: number | null; end_time?: string | null; error?: boolean | null; error_code?: string | null; error_message?: string | null; expiration_time?: string | null; id...`
471
+ - OpenAPI response codes: `200`
472
+
473
+ ```ts
474
+ import posthog from "@utdk/posthog";
475
+
476
+ type EnvironmentsEndpointsLastExecutionTimesCreateInput = Parameters<typeof posthog.environmentsEndpointsLastExecutionTimesCreate> extends [infer T, ...unknown[]] ? T : undefined;
477
+ type EnvironmentsEndpointsLastExecutionTimesCreateOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsLastExecutionTimesCreate>>;
478
+
479
+ const result: EnvironmentsEndpointsLastExecutionTimesCreateOutput = await posthog.environmentsEndpointsLastExecutionTimesCreate();
480
+
481
+ // Result shape (from schema): { query_status: { complete?: boolean | null; dashboard_id?: number | null; end_time?: string | null; error?: boolean | null; error_code?: string | null; error_message?: string | null; expiration_time?: string | null; id...
482
+ ```
483
+
484
+ ### `posthog.environmentsEndpointsMaterializationConditionsRetrieve`
485
+
486
+ - **HTTP**: `GET /api/environments/{environment_id}/endpoints/materialization_conditions/`
487
+ - **What it does**: Get the source code of the live materialization checks, plus the rewrite contract. Lets an agent rewrite a rejected endpoint query itself: fetch these conditions, produce a semantically equivalent query that passes every check, update the endpoint with it, then confirm via materialization_status. The source is read from the running system, so it always matches the checks this instance enforces.
488
+ - **OpenAPI operationId**: `environments_endpoints_materialization_conditions_retrieve`
489
+ - **Path params**: None
490
+ - **Query params**: None
491
+ - **Response codes**: `200`
492
+ - **Transport options**: None
493
+ - **TypeScript**: [Client interface](../types.ts)
494
+
495
+ **Inputs**
496
+
497
+ - Client input type: `{ [key: string]: unknown }`
498
+ - Client transport options: None
499
+
500
+ **Outputs**
501
+
502
+ - Client return type: `{ conditions_source: string; rewrite_contract: string }`
503
+ - OpenAPI response codes: `200`
504
+
505
+ ```ts
506
+ import posthog from "@utdk/posthog";
507
+
508
+ type EnvironmentsEndpointsMaterializationConditionsRetrieveInput = Parameters<typeof posthog.environmentsEndpointsMaterializationConditionsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
509
+ type EnvironmentsEndpointsMaterializationConditionsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsEndpointsMaterializationConditionsRetrieve>>;
510
+
511
+ const result: EnvironmentsEndpointsMaterializationConditionsRetrieveOutput = await posthog.environmentsEndpointsMaterializationConditionsRetrieve();
512
+
513
+ // Result shape (from schema): { conditions_source: string; rewrite_contract: string }
514
+ ```
515
+
516
+ ### `posthog.endpointsList`
517
+
518
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/`
519
+ - **What it does**: List all endpoints for the team.
520
+ - **OpenAPI operationId**: `endpoints_list`
521
+ - **Path params**: None
522
+ - **Query params**: `created_by`, `is_active`, `limit`, `offset`
523
+ - **Response codes**: `200`
524
+ - **Transport options**: None
525
+ - **TypeScript**: [Client interface](../types.ts)
526
+
527
+ **Inputs**
528
+
529
+ - Client input type: `{ [key: string]: unknown }`
530
+ - Client transport options: None
531
+
532
+ **Outputs**
533
+
534
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...`
535
+ - OpenAPI response codes: `200`
536
+
537
+ ```ts
538
+ import posthog from "@utdk/posthog";
539
+
540
+ type EndpointsListInput = Parameters<typeof posthog.endpointsList> extends [infer T, ...unknown[]] ? T : undefined;
541
+ type EndpointsListOutput = Awaited<ReturnType<typeof posthog.endpointsList>>;
542
+
543
+ const result: EndpointsListOutput = await posthog.endpointsList();
544
+
545
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...
546
+ ```
547
+
548
+ ### `posthog.endpointsCreate`
549
+
550
+ - **HTTP**: `POST /api/projects/{project_id}/endpoints/`
551
+ - **What it does**: Create a new endpoint.
552
+ - **OpenAPI operationId**: `endpoints_create`
553
+ - **Path params**: None
554
+ - **Query params**: None
555
+ - **Response codes**: `201`
556
+ - **Transport options**: None
557
+ - **TypeScript**: [Client interface](../types.ts)
558
+
559
+ **Inputs**
560
+
561
+ - Client input type: `{ [key: string]: unknown }`
562
+ - Client transport options: None
563
+
564
+ **Outputs**
565
+
566
+ - Client return type: `{ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
567
+ - OpenAPI response codes: `201`
568
+
569
+ ```ts
570
+ import posthog from "@utdk/posthog";
571
+
572
+ type EndpointsCreateInput = Parameters<typeof posthog.endpointsCreate> extends [infer T, ...unknown[]] ? T : undefined;
573
+ type EndpointsCreateOutput = Awaited<ReturnType<typeof posthog.endpointsCreate>>;
574
+
575
+ const result: EndpointsCreateOutput = await posthog.endpointsCreate();
576
+
577
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
578
+ ```
579
+
580
+ ### `posthog.endpointsDestroy`
581
+
582
+ - **HTTP**: `DELETE /api/projects/{project_id}/endpoints/{name}/`
583
+ - **What it does**: Delete an endpoint and clean up materialized query.
584
+ - **OpenAPI operationId**: `endpoints_destroy`
585
+ - **Path params**: `name`
586
+ - **Query params**: None
587
+ - **Response codes**: `204`
588
+ - **Transport options**: None
589
+ - **TypeScript**: [Client interface](../types.ts)
590
+
591
+ **Inputs**
592
+
593
+ - Client input type: `{ [key: string]: unknown }`
594
+ - Client transport options: None
595
+
596
+ **Outputs**
597
+
598
+ - Client return type: `unknown`
599
+ - OpenAPI response codes: `204`
600
+
601
+ ```ts
602
+ import posthog from "@utdk/posthog";
603
+
604
+ type EndpointsDestroyInput = Parameters<typeof posthog.endpointsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
605
+ type EndpointsDestroyOutput = Awaited<ReturnType<typeof posthog.endpointsDestroy>>;
606
+
607
+ const result: EndpointsDestroyOutput = await posthog.endpointsDestroy();
608
+
609
+ // Result shape (from schema): unknown
610
+ ```
611
+
612
+ ### `posthog.endpointsRetrieve`
613
+
614
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/{name}/`
615
+ - **What it does**: Retrieve an endpoint, or a specific version via ?version=N.
616
+ - **OpenAPI operationId**: `endpoints_retrieve`
617
+ - **Path params**: `name`
618
+ - **Query params**: None
619
+ - **Response codes**: `200`
620
+ - **Transport options**: None
621
+ - **TypeScript**: [Client interface](../types.ts)
622
+
623
+ **Inputs**
624
+
625
+ - Client input type: `{ [key: string]: unknown }`
626
+ - Client transport options: None
627
+
628
+ **Outputs**
629
+
630
+ - Client return type: `{ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
631
+ - OpenAPI response codes: `200`
632
+
633
+ ```ts
634
+ import posthog from "@utdk/posthog";
635
+
636
+ type EndpointsRetrieveInput = Parameters<typeof posthog.endpointsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
637
+ type EndpointsRetrieveOutput = Awaited<ReturnType<typeof posthog.endpointsRetrieve>>;
638
+
639
+ const result: EndpointsRetrieveOutput = await posthog.endpointsRetrieve();
640
+
641
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
642
+ ```
643
+
644
+ ### `posthog.endpointsPartialUpdate`
645
+
646
+ - **HTTP**: `PATCH /api/projects/{project_id}/endpoints/{name}/`
647
+ - **What it does**: Update an existing endpoint.
648
+ - **OpenAPI operationId**: `endpoints_partial_update`
649
+ - **Path params**: `name`
650
+ - **Query params**: None
651
+ - **Response codes**: `200`
652
+ - **Transport options**: None
653
+ - **TypeScript**: [Client interface](../types.ts)
654
+
655
+ **Inputs**
656
+
657
+ - Client input type: `{ [key: string]: unknown }`
658
+ - Client transport options: None
659
+
660
+ **Outputs**
661
+
662
+ - Client return type: `{ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
663
+ - OpenAPI response codes: `200`
664
+
665
+ ```ts
666
+ import posthog from "@utdk/posthog";
667
+
668
+ type EndpointsPartialUpdateInput = Parameters<typeof posthog.endpointsPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
669
+ type EndpointsPartialUpdateOutput = Awaited<ReturnType<typeof posthog.endpointsPartialUpdate>>;
670
+
671
+ const result: EndpointsPartialUpdateOutput = await posthog.endpointsPartialUpdate();
672
+
673
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
674
+ ```
675
+
676
+ ### `posthog.endpointsUpdate`
677
+
678
+ - **HTTP**: `PUT /api/projects/{project_id}/endpoints/{name}/`
679
+ - **What it does**: Update an existing endpoint. Parameters are optional. Pass version in body or ?version=N query param to target a specific version.
680
+ - **OpenAPI operationId**: `endpoints_update`
681
+ - **Path params**: `name`
682
+ - **Query params**: None
683
+ - **Response codes**: `200`
684
+ - **Transport options**: None
685
+ - **TypeScript**: [Client interface](../types.ts)
686
+
687
+ **Inputs**
688
+
689
+ - Client input type: `{ [key: string]: unknown }`
690
+ - Client transport options: None
691
+
692
+ **Outputs**
693
+
694
+ - Client return type: `{ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...`
695
+ - OpenAPI response codes: `200`
696
+
697
+ ```ts
698
+ import posthog from "@utdk/posthog";
699
+
700
+ type EndpointsUpdateInput = Parameters<typeof posthog.endpointsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
701
+ type EndpointsUpdateOutput = Awaited<ReturnType<typeof posthog.endpointsUpdate>>;
702
+
703
+ const result: EndpointsUpdateOutput = await posthog.endpointsUpdate();
704
+
705
+ // Result shape (from schema): { id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: string; url: string | null; ui_url: string | null; created_at: string; updated_a...
706
+ ```
707
+
708
+ ### `posthog.endpointsLogsRetrieve`
709
+
710
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/{name}/logs/`
711
+ - **OpenAPI operationId**: `endpoints_logs_retrieve`
712
+ - **Path params**: `name`
713
+ - **Query params**: `after`, `before`, `instance_id`, `level`, `limit`, `search`
714
+ - **Response codes**: `200`
715
+ - **Transport options**: None
716
+ - **TypeScript**: [Client interface](../types.ts)
717
+
718
+ **Inputs**
719
+
720
+ - Client input type: `{ [key: string]: unknown }`
721
+ - Client transport options: None
722
+
723
+ **Outputs**
724
+
725
+ - Client return type: `unknown`
726
+ - OpenAPI response codes: `200`
727
+
728
+ ```ts
729
+ import posthog from "@utdk/posthog";
730
+
731
+ type EndpointsLogsRetrieveInput = Parameters<typeof posthog.endpointsLogsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
732
+ type EndpointsLogsRetrieveOutput = Awaited<ReturnType<typeof posthog.endpointsLogsRetrieve>>;
733
+
734
+ const result: EndpointsLogsRetrieveOutput = await posthog.endpointsLogsRetrieve();
735
+
736
+ // Result shape (from schema): unknown
737
+ ```
738
+
739
+ ### `posthog.endpointsMaterializationPreviewCreate`
740
+
741
+ - **HTTP**: `POST /api/projects/{project_id}/endpoints/{name}/materialization_preview/`
742
+ - **What it does**: Preview the materialization transform for an endpoint. Shows what the query will look like after materialization, including range pair detection and bucket functions.
743
+ - **OpenAPI operationId**: `endpoints_materialization_preview_create`
744
+ - **Path params**: `name`
745
+ - **Query params**: None
746
+ - **Response codes**: `200`
747
+ - **Transport options**: None
748
+ - **TypeScript**: [Client interface](../types.ts)
749
+
750
+ **Inputs**
751
+
752
+ - Client input type: `{ [key: string]: unknown }`
753
+ - Client transport options: None
754
+
755
+ **Outputs**
756
+
757
+ - Client return type: `unknown`
758
+ - OpenAPI response codes: `200`
759
+
760
+ ```ts
761
+ import posthog from "@utdk/posthog";
762
+
763
+ type EndpointsMaterializationPreviewCreateInput = Parameters<typeof posthog.endpointsMaterializationPreviewCreate> extends [infer T, ...unknown[]] ? T : undefined;
764
+ type EndpointsMaterializationPreviewCreateOutput = Awaited<ReturnType<typeof posthog.endpointsMaterializationPreviewCreate>>;
765
+
766
+ const result: EndpointsMaterializationPreviewCreateOutput = await posthog.endpointsMaterializationPreviewCreate();
767
+
768
+ // Result shape (from schema): unknown
769
+ ```
770
+
771
+ ### `posthog.endpointsMaterializationStatusRetrieve`
772
+
773
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/{name}/materialization_status/`
774
+ - **What it does**: Get materialization status for an endpoint. Supports ?version=N query param.
775
+ - **OpenAPI operationId**: `endpoints_materialization_status_retrieve`
776
+ - **Path params**: `name`
777
+ - **Query params**: None
778
+ - **Response codes**: `200`
779
+ - **Transport options**: None
780
+ - **TypeScript**: [Client interface](../types.ts)
781
+
782
+ **Inputs**
783
+
784
+ - Client input type: `{ [key: string]: unknown }`
785
+ - Client transport options: None
786
+
787
+ **Outputs**
788
+
789
+ - Client return type: `{ name: string; status?: string; can_materialize: boolean; reason?: string | null; last_materialized_at?: string | null; error?: string; saved_query_id?: string | null }`
790
+ - OpenAPI response codes: `200`
791
+
792
+ ```ts
793
+ import posthog from "@utdk/posthog";
794
+
795
+ type EndpointsMaterializationStatusRetrieveInput = Parameters<typeof posthog.endpointsMaterializationStatusRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
796
+ type EndpointsMaterializationStatusRetrieveOutput = Awaited<ReturnType<typeof posthog.endpointsMaterializationStatusRetrieve>>;
797
+
798
+ const result: EndpointsMaterializationStatusRetrieveOutput = await posthog.endpointsMaterializationStatusRetrieve();
799
+
800
+ // Result shape (from schema): { name: string; status?: string; can_materialize: boolean; reason?: string | null; last_materialized_at?: string | null; error?: string; saved_query_id?: string | null }
801
+ ```
802
+
803
+ ### `posthog.endpointsMaterializationSuggestionCreate`
804
+
805
+ - **HTTP**: `POST /api/projects/{project_id}/endpoints/{name}/materialization_suggestion/`
806
+ - **What it does**: Ask AI to rewrite the endpoint's query into a semantically equivalent form that can be materialized. Only applicable to SQL (HogQL) endpoints that currently fail the materialization checks. The suggestion is validated against the live checks before being returned; nothing is saved. Requires the organization's AI data processing approval.
807
+ - **OpenAPI operationId**: `endpoints_materialization_suggestion_create`
808
+ - **Path params**: `name`
809
+ - **Query params**: None
810
+ - **Response codes**: `200`
811
+ - **Transport options**: None
812
+ - **TypeScript**: [Client interface](../types.ts)
813
+
814
+ **Inputs**
815
+
816
+ - Client input type: `{ [key: string]: unknown }`
817
+ - Client transport options: None
818
+
819
+ **Outputs**
820
+
821
+ - Client return type: `{ suggestion_status: "ok" | "cannot_fix" | "invalid" | "model_error"; suggested_query: string | null; explanation: string | null; attempts: number; error: string | null; original_reason: string }`
822
+ - OpenAPI response codes: `200`
823
+
824
+ ```ts
825
+ import posthog from "@utdk/posthog";
826
+
827
+ type EndpointsMaterializationSuggestionCreateInput = Parameters<typeof posthog.endpointsMaterializationSuggestionCreate> extends [infer T, ...unknown[]] ? T : undefined;
828
+ type EndpointsMaterializationSuggestionCreateOutput = Awaited<ReturnType<typeof posthog.endpointsMaterializationSuggestionCreate>>;
829
+
830
+ const result: EndpointsMaterializationSuggestionCreateOutput = await posthog.endpointsMaterializationSuggestionCreate();
831
+
832
+ // Result shape (from schema): { suggestion_status: "ok" | "cannot_fix" | "invalid" | "model_error"; suggested_query: string | null; explanation: string | null; attempts: number; error: string | null; original_reason: string }
833
+ ```
834
+
835
+ ### `posthog.endpointsOpenapiSpecRetrieve`
836
+
837
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/{name}/openapi.json/`
838
+ - **What it does**: Get OpenAPI 3.0 specification for this endpoint. Use this to generate typed SDK clients.
839
+ - **OpenAPI operationId**: `endpoints_openapi_spec_retrieve`
840
+ - **Path params**: `name`
841
+ - **Query params**: `version`
842
+ - **Response codes**: `200`
843
+ - **Transport options**: None
844
+ - **TypeScript**: [Client interface](../types.ts)
845
+
846
+ **Inputs**
847
+
848
+ - Client input type: `{ [key: string]: unknown }`
849
+ - Client transport options: None
850
+
851
+ **Outputs**
852
+
853
+ - Client return type: `unknown`
854
+ - OpenAPI response codes: `200`
855
+
856
+ ```ts
857
+ import posthog from "@utdk/posthog";
858
+
859
+ type EndpointsOpenapiSpecRetrieveInput = Parameters<typeof posthog.endpointsOpenapiSpecRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
860
+ type EndpointsOpenapiSpecRetrieveOutput = Awaited<ReturnType<typeof posthog.endpointsOpenapiSpecRetrieve>>;
861
+
862
+ const result: EndpointsOpenapiSpecRetrieveOutput = await posthog.endpointsOpenapiSpecRetrieve();
863
+
864
+ // Result shape (from schema): unknown
865
+ ```
866
+
867
+ ### `posthog.endpointsRunRetrieve`
868
+
869
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/{name}/run/`
870
+ - **What it does**: Execute endpoint with optional materialization. Supports version parameter, runs latest version if not set.
871
+ - **OpenAPI operationId**: `endpoints_run_retrieve`
872
+ - **Path params**: `name`
873
+ - **Query params**: None
874
+ - **Response codes**: `200`
875
+ - **Transport options**: None
876
+ - **TypeScript**: [Client interface](../types.ts)
877
+
878
+ **Inputs**
879
+
880
+ - Client input type: `{ [key: string]: unknown }`
881
+ - Client transport options: None
882
+
883
+ **Outputs**
884
+
885
+ - Client return type: `{ name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }`
886
+ - OpenAPI response codes: `200`
887
+
888
+ ```ts
889
+ import posthog from "@utdk/posthog";
890
+
891
+ type EndpointsRunRetrieveInput = Parameters<typeof posthog.endpointsRunRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
892
+ type EndpointsRunRetrieveOutput = Awaited<ReturnType<typeof posthog.endpointsRunRetrieve>>;
893
+
894
+ const result: EndpointsRunRetrieveOutput = await posthog.endpointsRunRetrieve();
895
+
896
+ // Result shape (from schema): { name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }
897
+ ```
898
+
899
+ ### `posthog.endpointsRunCreate`
900
+
901
+ - **HTTP**: `POST /api/projects/{project_id}/endpoints/{name}/run/`
902
+ - **What it does**: Execute endpoint with optional materialization. Supports version parameter, runs latest version if not set.
903
+ - **OpenAPI operationId**: `endpoints_run_create`
904
+ - **Path params**: `name`
905
+ - **Query params**: None
906
+ - **Response codes**: `200`
907
+ - **Transport options**: None
908
+ - **TypeScript**: [Client interface](../types.ts)
909
+
910
+ **Inputs**
911
+
912
+ - Client input type: `{ [key: string]: unknown }`
913
+ - Client transport options: None
914
+
915
+ **Outputs**
916
+
917
+ - Client return type: `{ name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }`
918
+ - OpenAPI response codes: `200`
919
+
920
+ ```ts
921
+ import posthog from "@utdk/posthog";
922
+
923
+ type EndpointsRunCreateInput = Parameters<typeof posthog.endpointsRunCreate> extends [infer T, ...unknown[]] ? T : undefined;
924
+ type EndpointsRunCreateOutput = Awaited<ReturnType<typeof posthog.endpointsRunCreate>>;
925
+
926
+ const result: EndpointsRunCreateOutput = await posthog.endpointsRunCreate();
927
+
928
+ // Result shape (from schema): { name: string; execution_id?: string; results?: (unknown)[]; columns?: (string)[]; hasMore?: boolean; endpoint_version?: number }
929
+ ```
930
+
931
+ ### `posthog.endpointsVersionsList`
932
+
933
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/{name}/versions/`
934
+ - **What it does**: List all versions for an endpoint.
935
+ - **OpenAPI operationId**: `endpoints_versions_list`
936
+ - **Path params**: `name`
937
+ - **Query params**: `created_by`, `is_active`, `limit`, `offset`
938
+ - **Response codes**: `200`
939
+ - **Transport options**: None
940
+ - **TypeScript**: [Client interface](../types.ts)
941
+
942
+ **Inputs**
943
+
944
+ - Client input type: `{ [key: string]: unknown }`
945
+ - Client transport options: None
946
+
947
+ **Outputs**
948
+
949
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...`
950
+ - OpenAPI response codes: `200`
951
+
952
+ ```ts
953
+ import posthog from "@utdk/posthog";
954
+
955
+ type EndpointsVersionsListInput = Parameters<typeof posthog.endpointsVersionsList> extends [infer T, ...unknown[]] ? T : undefined;
956
+ type EndpointsVersionsListOutput = Awaited<ReturnType<typeof posthog.endpointsVersionsList>>;
957
+
958
+ const result: EndpointsVersionsListOutput = await posthog.endpointsVersionsList();
959
+
960
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; name: string; description: string | null; query: unknown; is_active: boolean; data_freshness_seconds: number; endpoint_path: strin...
961
+ ```
962
+
963
+ ### `posthog.endpointsLastExecutionTimesCreate`
964
+
965
+ - **HTTP**: `POST /api/projects/{project_id}/endpoints/last_execution_times/`
966
+ - **What it does**: Get the most recent execution time per endpoint (endpoint-level). Timestamps are recorded by the run path for personal-API-key calls. For per-version usage, query the query_log table directly.
967
+ - **OpenAPI operationId**: `endpoints_last_execution_times_create`
968
+ - **Path params**: None
969
+ - **Query params**: None
970
+ - **Response codes**: `200`
971
+ - **Transport options**: None
972
+ - **TypeScript**: [Client interface](../types.ts)
973
+
974
+ **Inputs**
975
+
976
+ - Client input type: `{ [key: string]: unknown }`
977
+ - Client transport options: None
978
+
979
+ **Outputs**
980
+
981
+ - Client return type: `{ query_status: { complete?: boolean | null; dashboard_id?: number | null; end_time?: string | null; error?: boolean | null; error_code?: string | null; error_message?: string | null; expiration_time?: string | null; id...`
982
+ - OpenAPI response codes: `200`
983
+
984
+ ```ts
985
+ import posthog from "@utdk/posthog";
986
+
987
+ type EndpointsLastExecutionTimesCreateInput = Parameters<typeof posthog.endpointsLastExecutionTimesCreate> extends [infer T, ...unknown[]] ? T : undefined;
988
+ type EndpointsLastExecutionTimesCreateOutput = Awaited<ReturnType<typeof posthog.endpointsLastExecutionTimesCreate>>;
989
+
990
+ const result: EndpointsLastExecutionTimesCreateOutput = await posthog.endpointsLastExecutionTimesCreate();
991
+
992
+ // Result shape (from schema): { query_status: { complete?: boolean | null; dashboard_id?: number | null; end_time?: string | null; error?: boolean | null; error_code?: string | null; error_message?: string | null; expiration_time?: string | null; id...
993
+ ```
994
+
995
+ ### `posthog.endpointsMaterializationConditionsRetrieve`
996
+
997
+ - **HTTP**: `GET /api/projects/{project_id}/endpoints/materialization_conditions/`
998
+ - **What it does**: Get the source code of the live materialization checks, plus the rewrite contract. Lets an agent rewrite a rejected endpoint query itself: fetch these conditions, produce a semantically equivalent query that passes every check, update the endpoint with it, then confirm via materialization_status. The source is read from the running system, so it always matches the checks this instance enforces.
999
+ - **OpenAPI operationId**: `endpoints_materialization_conditions_retrieve`
1000
+ - **Path params**: None
1001
+ - **Query params**: None
1002
+ - **Response codes**: `200`
1003
+ - **Transport options**: None
1004
+ - **TypeScript**: [Client interface](../types.ts)
1005
+
1006
+ **Inputs**
1007
+
1008
+ - Client input type: `{ [key: string]: unknown }`
1009
+ - Client transport options: None
1010
+
1011
+ **Outputs**
1012
+
1013
+ - Client return type: `{ conditions_source: string; rewrite_contract: string }`
1014
+ - OpenAPI response codes: `200`
1015
+
1016
+ ```ts
1017
+ import posthog from "@utdk/posthog";
1018
+
1019
+ type EndpointsMaterializationConditionsRetrieveInput = Parameters<typeof posthog.endpointsMaterializationConditionsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1020
+ type EndpointsMaterializationConditionsRetrieveOutput = Awaited<ReturnType<typeof posthog.endpointsMaterializationConditionsRetrieve>>;
1021
+
1022
+ const result: EndpointsMaterializationConditionsRetrieveOutput = await posthog.endpointsMaterializationConditionsRetrieve();
1023
+
1024
+ // Result shape (from schema): { conditions_source: string; rewrite_contract: string }
1025
+ ```
1026
+
1027
+
1028
+ <!-- prompt-hash:
1029
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
1030
+ -->