@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,1722 @@
1
+ # Insights
2
+
3
+ ## Operations
4
+
5
+ ### `posthog.environmentsInsightsList`
6
+
7
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/`
8
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
9
+
10
+ The QueryCoalescingMiddleware attaches cached response data to
11
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
12
+ initial() (auth + permissions + throttling) before returning the
13
+ cached response, ensuring the request is authorized.
14
+ - **OpenAPI operationId**: `environments_insights_list`
15
+ - **Path params**: None
16
+ - **Query params**: `basic`, `created_by`, `created_date_from`, `created_date_to`, `dashboards`, `date_from`, `date_to`, `favorited`, `format`, `insight`, `last_viewed_date_from`, `last_viewed_date_to`, `limit`, `offset`, `refresh`, `saved`, `search`, `short_id`, `tags`, `user`
17
+ - **Response codes**: `200`
18
+ - **Transport options**: None
19
+ - **TypeScript**: [Client interface](../types.ts)
20
+
21
+ **Inputs**
22
+
23
+ - Client input type: `{ [key: string]: unknown }`
24
+ - Client transport options: None
25
+
26
+ **Outputs**
27
+
28
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; ...`
29
+ - OpenAPI response codes: `200`
30
+
31
+ ```ts
32
+ import posthog from "@utdk/posthog";
33
+
34
+ type EnvironmentsInsightsListInput = Parameters<typeof posthog.environmentsInsightsList> extends [infer T, ...unknown[]] ? T : undefined;
35
+ type EnvironmentsInsightsListOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsList>>;
36
+
37
+ const result: EnvironmentsInsightsListOutput = await posthog.environmentsInsightsList();
38
+
39
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; ...
40
+ ```
41
+
42
+ ### `posthog.environmentsInsightsCreate`
43
+
44
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/`
45
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
46
+
47
+ The QueryCoalescingMiddleware attaches cached response data to
48
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
49
+ initial() (auth + permissions + throttling) before returning the
50
+ cached response, ensuring the request is authorized.
51
+ - **OpenAPI operationId**: `environments_insights_create`
52
+ - **Path params**: None
53
+ - **Query params**: `format`
54
+ - **Response codes**: `201`
55
+ - **Transport options**: None
56
+ - **TypeScript**: [Client interface](../types.ts)
57
+
58
+ **Inputs**
59
+
60
+ - Client input type: `{ [key: string]: unknown }`
61
+ - Client transport options: None
62
+
63
+ **Outputs**
64
+
65
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
66
+ - OpenAPI response codes: `201`
67
+
68
+ ```ts
69
+ import posthog from "@utdk/posthog";
70
+
71
+ type EnvironmentsInsightsCreateInput = Parameters<typeof posthog.environmentsInsightsCreate> extends [infer T, ...unknown[]] ? T : undefined;
72
+ type EnvironmentsInsightsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsCreate>>;
73
+
74
+ const result: EnvironmentsInsightsCreateOutput = await posthog.environmentsInsightsCreate();
75
+
76
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
77
+ ```
78
+
79
+ ### `posthog.environmentsInsightsDestroy`
80
+
81
+ - **HTTP**: `DELETE /api/environments/{environment_id}/insights/{id}/`
82
+ - **What it does**: Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
83
+ - **OpenAPI operationId**: `environments_insights_destroy`
84
+ - **Path params**: `id`
85
+ - **Query params**: `format`
86
+ - **Response codes**: `405`
87
+ - **Transport options**: None
88
+ - **TypeScript**: [Client interface](../types.ts)
89
+
90
+ **Inputs**
91
+
92
+ - Client input type: `{ [key: string]: unknown }`
93
+ - Client transport options: None
94
+
95
+ **Outputs**
96
+
97
+ - Client return type: `unknown`
98
+ - OpenAPI response codes: `405`
99
+
100
+ ```ts
101
+ import posthog from "@utdk/posthog";
102
+
103
+ type EnvironmentsInsightsDestroyInput = Parameters<typeof posthog.environmentsInsightsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
104
+ type EnvironmentsInsightsDestroyOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsDestroy>>;
105
+
106
+ const result: EnvironmentsInsightsDestroyOutput = await posthog.environmentsInsightsDestroy();
107
+
108
+ // Result shape (from schema): unknown
109
+ ```
110
+
111
+ ### `posthog.environmentsInsightsRetrieve`
112
+
113
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{id}/`
114
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
115
+
116
+ The QueryCoalescingMiddleware attaches cached response data to
117
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
118
+ initial() (auth + permissions + throttling) before returning the
119
+ cached response, ensuring the request is authorized.
120
+ - **OpenAPI operationId**: `environments_insights_retrieve`
121
+ - **Path params**: `id`
122
+ - **Query params**: `filters_override`, `format`, `from_dashboard`, `refresh`, `variables_override`
123
+ - **Response codes**: `200`
124
+ - **Transport options**: None
125
+ - **TypeScript**: [Client interface](../types.ts)
126
+
127
+ **Inputs**
128
+
129
+ - Client input type: `{ [key: string]: unknown }`
130
+ - Client transport options: None
131
+
132
+ **Outputs**
133
+
134
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
135
+ - OpenAPI response codes: `200`
136
+
137
+ ```ts
138
+ import posthog from "@utdk/posthog";
139
+
140
+ type EnvironmentsInsightsRetrieveInput = Parameters<typeof posthog.environmentsInsightsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
141
+ type EnvironmentsInsightsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsRetrieve>>;
142
+
143
+ const result: EnvironmentsInsightsRetrieveOutput = await posthog.environmentsInsightsRetrieve();
144
+
145
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
146
+ ```
147
+
148
+ ### `posthog.environmentsInsightsPartialUpdate`
149
+
150
+ - **HTTP**: `PATCH /api/environments/{environment_id}/insights/{id}/`
151
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
152
+
153
+ The QueryCoalescingMiddleware attaches cached response data to
154
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
155
+ initial() (auth + permissions + throttling) before returning the
156
+ cached response, ensuring the request is authorized.
157
+ - **OpenAPI operationId**: `environments_insights_partial_update`
158
+ - **Path params**: `id`
159
+ - **Query params**: `format`
160
+ - **Response codes**: `200`
161
+ - **Transport options**: None
162
+ - **TypeScript**: [Client interface](../types.ts)
163
+
164
+ **Inputs**
165
+
166
+ - Client input type: `{ [key: string]: unknown }`
167
+ - Client transport options: None
168
+
169
+ **Outputs**
170
+
171
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
172
+ - OpenAPI response codes: `200`
173
+
174
+ ```ts
175
+ import posthog from "@utdk/posthog";
176
+
177
+ type EnvironmentsInsightsPartialUpdateInput = Parameters<typeof posthog.environmentsInsightsPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
178
+ type EnvironmentsInsightsPartialUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsPartialUpdate>>;
179
+
180
+ const result: EnvironmentsInsightsPartialUpdateOutput = await posthog.environmentsInsightsPartialUpdate();
181
+
182
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
183
+ ```
184
+
185
+ ### `posthog.environmentsInsightsUpdate`
186
+
187
+ - **HTTP**: `PUT /api/environments/{environment_id}/insights/{id}/`
188
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
189
+
190
+ The QueryCoalescingMiddleware attaches cached response data to
191
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
192
+ initial() (auth + permissions + throttling) before returning the
193
+ cached response, ensuring the request is authorized.
194
+ - **OpenAPI operationId**: `environments_insights_update`
195
+ - **Path params**: `id`
196
+ - **Query params**: `format`
197
+ - **Response codes**: `200`
198
+ - **Transport options**: None
199
+ - **TypeScript**: [Client interface](../types.ts)
200
+
201
+ **Inputs**
202
+
203
+ - Client input type: `{ [key: string]: unknown }`
204
+ - Client transport options: None
205
+
206
+ **Outputs**
207
+
208
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
209
+ - OpenAPI response codes: `200`
210
+
211
+ ```ts
212
+ import posthog from "@utdk/posthog";
213
+
214
+ type EnvironmentsInsightsUpdateInput = Parameters<typeof posthog.environmentsInsightsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
215
+ type EnvironmentsInsightsUpdateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsUpdate>>;
216
+
217
+ const result: EnvironmentsInsightsUpdateOutput = await posthog.environmentsInsightsUpdate();
218
+
219
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
220
+ ```
221
+
222
+ ### `posthog.environmentsInsightsActivityRetrieve`
223
+
224
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{id}/activity/`
225
+ - **What it does**: Audit trail for a single insight — every change made to it, by whom, and when. Use this when you want the change history of a specific insight; use the project-wide activity endpoint for a broader view.
226
+ - **OpenAPI operationId**: `environments_insights_activity_retrieve`
227
+ - **Path params**: `id`
228
+ - **Query params**: `format`, `limit`, `page`
229
+ - **Response codes**: `200`
230
+ - **Transport options**: None
231
+ - **TypeScript**: [Client interface](../types.ts)
232
+
233
+ **Inputs**
234
+
235
+ - Client input type: `{ [key: string]: unknown }`
236
+ - Client transport options: None
237
+
238
+ **Outputs**
239
+
240
+ - Client return type: `{ results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...`
241
+ - OpenAPI response codes: `200`
242
+
243
+ ```ts
244
+ import posthog from "@utdk/posthog";
245
+
246
+ type EnvironmentsInsightsActivityRetrieveInput = Parameters<typeof posthog.environmentsInsightsActivityRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
247
+ type EnvironmentsInsightsActivityRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsActivityRetrieve>>;
248
+
249
+ const result: EnvironmentsInsightsActivityRetrieveOutput = await posthog.environmentsInsightsActivityRetrieve();
250
+
251
+ // Result shape (from schema): { results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...
252
+ ```
253
+
254
+ ### `posthog.environmentsInsightsAnalyzeRetrieve`
255
+
256
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{id}/analyze/`
257
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
258
+
259
+ The QueryCoalescingMiddleware attaches cached response data to
260
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
261
+ initial() (auth + permissions + throttling) before returning the
262
+ cached response, ensuring the request is authorized.
263
+ - **OpenAPI operationId**: `environments_insights_analyze_retrieve`
264
+ - **Path params**: `id`
265
+ - **Query params**: `format`
266
+ - **Response codes**: `200`
267
+ - **Transport options**: None
268
+ - **TypeScript**: [Client interface](../types.ts)
269
+
270
+ **Inputs**
271
+
272
+ - Client input type: `{ [key: string]: unknown }`
273
+ - Client transport options: None
274
+
275
+ **Outputs**
276
+
277
+ - Client return type: `unknown`
278
+ - OpenAPI response codes: `200`
279
+
280
+ ```ts
281
+ import posthog from "@utdk/posthog";
282
+
283
+ type EnvironmentsInsightsAnalyzeRetrieveInput = Parameters<typeof posthog.environmentsInsightsAnalyzeRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
284
+ type EnvironmentsInsightsAnalyzeRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsAnalyzeRetrieve>>;
285
+
286
+ const result: EnvironmentsInsightsAnalyzeRetrieveOutput = await posthog.environmentsInsightsAnalyzeRetrieve();
287
+
288
+ // Result shape (from schema): unknown
289
+ ```
290
+
291
+ ### `posthog.environmentsInsightsSuggestionsRetrieve`
292
+
293
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{id}/suggestions/`
294
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
295
+
296
+ The QueryCoalescingMiddleware attaches cached response data to
297
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
298
+ initial() (auth + permissions + throttling) before returning the
299
+ cached response, ensuring the request is authorized.
300
+ - **OpenAPI operationId**: `environments_insights_suggestions_retrieve`
301
+ - **Path params**: `id`
302
+ - **Query params**: `format`
303
+ - **Response codes**: `200`
304
+ - **Transport options**: None
305
+ - **TypeScript**: [Client interface](../types.ts)
306
+
307
+ **Inputs**
308
+
309
+ - Client input type: `{ [key: string]: unknown }`
310
+ - Client transport options: None
311
+
312
+ **Outputs**
313
+
314
+ - Client return type: `unknown`
315
+ - OpenAPI response codes: `200`
316
+
317
+ ```ts
318
+ import posthog from "@utdk/posthog";
319
+
320
+ type EnvironmentsInsightsSuggestionsRetrieveInput = Parameters<typeof posthog.environmentsInsightsSuggestionsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
321
+ type EnvironmentsInsightsSuggestionsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsSuggestionsRetrieve>>;
322
+
323
+ const result: EnvironmentsInsightsSuggestionsRetrieveOutput = await posthog.environmentsInsightsSuggestionsRetrieve();
324
+
325
+ // Result shape (from schema): unknown
326
+ ```
327
+
328
+ ### `posthog.environmentsInsightsSuggestionsCreate`
329
+
330
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/{id}/suggestions/`
331
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
332
+
333
+ The QueryCoalescingMiddleware attaches cached response data to
334
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
335
+ initial() (auth + permissions + throttling) before returning the
336
+ cached response, ensuring the request is authorized.
337
+ - **OpenAPI operationId**: `environments_insights_suggestions_create`
338
+ - **Path params**: `id`
339
+ - **Query params**: `format`
340
+ - **Response codes**: `200`
341
+ - **Transport options**: None
342
+ - **TypeScript**: [Client interface](../types.ts)
343
+
344
+ **Inputs**
345
+
346
+ - Client input type: `{ [key: string]: unknown }`
347
+ - Client transport options: None
348
+
349
+ **Outputs**
350
+
351
+ - Client return type: `unknown`
352
+ - OpenAPI response codes: `200`
353
+
354
+ ```ts
355
+ import posthog from "@utdk/posthog";
356
+
357
+ type EnvironmentsInsightsSuggestionsCreateInput = Parameters<typeof posthog.environmentsInsightsSuggestionsCreate> extends [infer T, ...unknown[]] ? T : undefined;
358
+ type EnvironmentsInsightsSuggestionsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsSuggestionsCreate>>;
359
+
360
+ const result: EnvironmentsInsightsSuggestionsCreateOutput = await posthog.environmentsInsightsSuggestionsCreate();
361
+
362
+ // Result shape (from schema): unknown
363
+ ```
364
+
365
+ ### `posthog.environmentsInsightsSharingList`
366
+
367
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{insight_id}/sharing/`
368
+ - **OpenAPI operationId**: `environments_insights_sharing_list`
369
+ - **Path params**: `insight_id`
370
+ - **Query params**: None
371
+ - **Response codes**: `200`
372
+ - **Transport options**: None
373
+ - **TypeScript**: [Client interface](../types.ts)
374
+
375
+ **Inputs**
376
+
377
+ - Client input type: `{ [key: string]: unknown }`
378
+ - Client transport options: None
379
+
380
+ **Outputs**
381
+
382
+ - Client return type: `({ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string;...`
383
+ - OpenAPI response codes: `200`
384
+
385
+ ```ts
386
+ import posthog from "@utdk/posthog";
387
+
388
+ type EnvironmentsInsightsSharingListInput = Parameters<typeof posthog.environmentsInsightsSharingList> extends [infer T, ...unknown[]] ? T : undefined;
389
+ type EnvironmentsInsightsSharingListOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsSharingList>>;
390
+
391
+ const result: EnvironmentsInsightsSharingListOutput = await posthog.environmentsInsightsSharingList();
392
+
393
+ // Result shape (from schema): ({ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string;...
394
+ ```
395
+
396
+ ### `posthog.environmentsInsightsSharingPasswordsCreate`
397
+
398
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/{insight_id}/sharing/passwords/`
399
+ - **What it does**: Create a new password for the sharing configuration.
400
+ - **OpenAPI operationId**: `environments_insights_sharing_passwords_create`
401
+ - **Path params**: `insight_id`
402
+ - **Query params**: None
403
+ - **Response codes**: `200`
404
+ - **Transport options**: None
405
+ - **TypeScript**: [Client interface](../types.ts)
406
+
407
+ **Inputs**
408
+
409
+ - Client input type: `{ [key: string]: unknown }`
410
+ - Client transport options: None
411
+
412
+ **Outputs**
413
+
414
+ - Client return type: `{ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...`
415
+ - OpenAPI response codes: `200`
416
+
417
+ ```ts
418
+ import posthog from "@utdk/posthog";
419
+
420
+ type EnvironmentsInsightsSharingPasswordsCreateInput = Parameters<typeof posthog.environmentsInsightsSharingPasswordsCreate> extends [infer T, ...unknown[]] ? T : undefined;
421
+ type EnvironmentsInsightsSharingPasswordsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsSharingPasswordsCreate>>;
422
+
423
+ const result: EnvironmentsInsightsSharingPasswordsCreateOutput = await posthog.environmentsInsightsSharingPasswordsCreate();
424
+
425
+ // Result shape (from schema): { created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...
426
+ ```
427
+
428
+ ### `posthog.environmentsInsightsSharingPasswordsDestroy`
429
+
430
+ - **HTTP**: `DELETE /api/environments/{environment_id}/insights/{insight_id}/sharing/passwords/{password_id}/`
431
+ - **What it does**: Delete a password from the sharing configuration.
432
+ - **OpenAPI operationId**: `environments_insights_sharing_passwords_destroy`
433
+ - **Path params**: `insight_id`, `password_id`
434
+ - **Query params**: None
435
+ - **Response codes**: `204`
436
+ - **Transport options**: None
437
+ - **TypeScript**: [Client interface](../types.ts)
438
+
439
+ **Inputs**
440
+
441
+ - Client input type: `{ [key: string]: unknown }`
442
+ - Client transport options: None
443
+
444
+ **Outputs**
445
+
446
+ - Client return type: `unknown`
447
+ - OpenAPI response codes: `204`
448
+
449
+ ```ts
450
+ import posthog from "@utdk/posthog";
451
+
452
+ type EnvironmentsInsightsSharingPasswordsDestroyInput = Parameters<typeof posthog.environmentsInsightsSharingPasswordsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
453
+ type EnvironmentsInsightsSharingPasswordsDestroyOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsSharingPasswordsDestroy>>;
454
+
455
+ const result: EnvironmentsInsightsSharingPasswordsDestroyOutput = await posthog.environmentsInsightsSharingPasswordsDestroy();
456
+
457
+ // Result shape (from schema): unknown
458
+ ```
459
+
460
+ ### `posthog.environmentsInsightsSharingRefreshCreate`
461
+
462
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/{insight_id}/sharing/refresh/`
463
+ - **OpenAPI operationId**: `environments_insights_sharing_refresh_create`
464
+ - **Path params**: `insight_id`
465
+ - **Query params**: None
466
+ - **Response codes**: `200`
467
+ - **Transport options**: None
468
+ - **TypeScript**: [Client interface](../types.ts)
469
+
470
+ **Inputs**
471
+
472
+ - Client input type: `{ [key: string]: unknown }`
473
+ - Client transport options: None
474
+
475
+ **Outputs**
476
+
477
+ - Client return type: `{ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...`
478
+ - OpenAPI response codes: `200`
479
+
480
+ ```ts
481
+ import posthog from "@utdk/posthog";
482
+
483
+ type EnvironmentsInsightsSharingRefreshCreateInput = Parameters<typeof posthog.environmentsInsightsSharingRefreshCreate> extends [infer T, ...unknown[]] ? T : undefined;
484
+ type EnvironmentsInsightsSharingRefreshCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsSharingRefreshCreate>>;
485
+
486
+ const result: EnvironmentsInsightsSharingRefreshCreateOutput = await posthog.environmentsInsightsSharingRefreshCreate();
487
+
488
+ // Result shape (from schema): { created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...
489
+ ```
490
+
491
+ ### `posthog.environmentsInsightsThresholdsList`
492
+
493
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{insight_id}/thresholds/`
494
+ - **OpenAPI operationId**: `environments_insights_thresholds_list`
495
+ - **Path params**: `insight_id`
496
+ - **Query params**: `limit`, `offset`
497
+ - **Response codes**: `200`
498
+ - **Transport options**: None
499
+ - **TypeScript**: [Client interface](../types.ts)
500
+
501
+ **Inputs**
502
+
503
+ - Client input type: `{ [key: string]: unknown }`
504
+ - Client transport options: None
505
+
506
+ **Outputs**
507
+
508
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absol...`
509
+ - OpenAPI response codes: `200`
510
+
511
+ ```ts
512
+ import posthog from "@utdk/posthog";
513
+
514
+ type EnvironmentsInsightsThresholdsListInput = Parameters<typeof posthog.environmentsInsightsThresholdsList> extends [infer T, ...unknown[]] ? T : undefined;
515
+ type EnvironmentsInsightsThresholdsListOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsThresholdsList>>;
516
+
517
+ const result: EnvironmentsInsightsThresholdsListOutput = await posthog.environmentsInsightsThresholdsList();
518
+
519
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absol...
520
+ ```
521
+
522
+ ### `posthog.environmentsInsightsThresholdsRetrieve`
523
+
524
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/{insight_id}/thresholds/{id}/`
525
+ - **OpenAPI operationId**: `environments_insights_thresholds_retrieve`
526
+ - **Path params**: `id`, `insight_id`
527
+ - **Query params**: None
528
+ - **Response codes**: `200`
529
+ - **Transport options**: None
530
+ - **TypeScript**: [Client interface](../types.ts)
531
+
532
+ **Inputs**
533
+
534
+ - Client input type: `{ [key: string]: unknown }`
535
+ - Client transport options: None
536
+
537
+ **Outputs**
538
+
539
+ - Client return type: `{ id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absolute" | "percentage" }; alerts: ({ id: string; created_by: { id: number; uui...`
540
+ - OpenAPI response codes: `200`
541
+
542
+ ```ts
543
+ import posthog from "@utdk/posthog";
544
+
545
+ type EnvironmentsInsightsThresholdsRetrieveInput = Parameters<typeof posthog.environmentsInsightsThresholdsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
546
+ type EnvironmentsInsightsThresholdsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsThresholdsRetrieve>>;
547
+
548
+ const result: EnvironmentsInsightsThresholdsRetrieveOutput = await posthog.environmentsInsightsThresholdsRetrieve();
549
+
550
+ // Result shape (from schema): { id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absolute" | "percentage" }; alerts: ({ id: string; created_by: { id: number; uui...
551
+ ```
552
+
553
+ ### `posthog.environmentsInsightsAllActivityRetrieve`
554
+
555
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/activity/`
556
+ - **What it does**: Project-wide audit trail across all insights — who created, edited, deleted, or restored insights, what changed (with before/after diffs), and when. Useful for surfacing what people (or agents) have been working on recently.
557
+ - **OpenAPI operationId**: `environments_insights_all_activity_retrieve`
558
+ - **Path params**: None
559
+ - **Query params**: `format`, `limit`, `page`
560
+ - **Response codes**: `200`
561
+ - **Transport options**: None
562
+ - **TypeScript**: [Client interface](../types.ts)
563
+
564
+ **Inputs**
565
+
566
+ - Client input type: `{ [key: string]: unknown }`
567
+ - Client transport options: None
568
+
569
+ **Outputs**
570
+
571
+ - Client return type: `{ results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...`
572
+ - OpenAPI response codes: `200`
573
+
574
+ ```ts
575
+ import posthog from "@utdk/posthog";
576
+
577
+ type EnvironmentsInsightsAllActivityRetrieveInput = Parameters<typeof posthog.environmentsInsightsAllActivityRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
578
+ type EnvironmentsInsightsAllActivityRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsAllActivityRetrieve>>;
579
+
580
+ const result: EnvironmentsInsightsAllActivityRetrieveOutput = await posthog.environmentsInsightsAllActivityRetrieve();
581
+
582
+ // Result shape (from schema): { results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...
583
+ ```
584
+
585
+ ### `posthog.environmentsInsightsBulkDeleteCreate`
586
+
587
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/bulk_delete/`
588
+ - **What it does**: Soft-delete insights in bulk by ID. Mirrors the single-insight delete: sets deleted=True, soft-deletes the insights' dashboard tiles, and removes their linked alerts. Insights the requester cannot edit are skipped and reported in `skipped`. Reversible via the bulk_restore endpoint.
589
+ - **OpenAPI operationId**: `environments_insights_bulk_delete_create`
590
+ - **Path params**: None
591
+ - **Query params**: `format`
592
+ - **Response codes**: `200`
593
+ - **Transport options**: None
594
+ - **TypeScript**: [Client interface](../types.ts)
595
+
596
+ **Inputs**
597
+
598
+ - Client input type: `{ [key: string]: unknown }`
599
+ - Client transport options: None
600
+
601
+ **Outputs**
602
+
603
+ - Client return type: `{ deleted: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }`
604
+ - OpenAPI response codes: `200`
605
+
606
+ ```ts
607
+ import posthog from "@utdk/posthog";
608
+
609
+ type EnvironmentsInsightsBulkDeleteCreateInput = Parameters<typeof posthog.environmentsInsightsBulkDeleteCreate> extends [infer T, ...unknown[]] ? T : undefined;
610
+ type EnvironmentsInsightsBulkDeleteCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsBulkDeleteCreate>>;
611
+
612
+ const result: EnvironmentsInsightsBulkDeleteCreateOutput = await posthog.environmentsInsightsBulkDeleteCreate();
613
+
614
+ // Result shape (from schema): { deleted: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }
615
+ ```
616
+
617
+ ### `posthog.environmentsInsightsBulkRestoreCreate`
618
+
619
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/bulk_restore/`
620
+ - **What it does**: Restore soft-deleted insights in bulk by ID — the inverse of bulk_delete. Sets deleted=False and re-activates the insights' dashboard tiles on dashboards that still exist. Linked alerts are not restored (they are removed on delete). Insights the requester cannot edit are reported in `skipped`.
621
+ - **OpenAPI operationId**: `environments_insights_bulk_restore_create`
622
+ - **Path params**: None
623
+ - **Query params**: `format`
624
+ - **Response codes**: `200`
625
+ - **Transport options**: None
626
+ - **TypeScript**: [Client interface](../types.ts)
627
+
628
+ **Inputs**
629
+
630
+ - Client input type: `{ [key: string]: unknown }`
631
+ - Client transport options: None
632
+
633
+ **Outputs**
634
+
635
+ - Client return type: `{ restored: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }`
636
+ - OpenAPI response codes: `200`
637
+
638
+ ```ts
639
+ import posthog from "@utdk/posthog";
640
+
641
+ type EnvironmentsInsightsBulkRestoreCreateInput = Parameters<typeof posthog.environmentsInsightsBulkRestoreCreate> extends [infer T, ...unknown[]] ? T : undefined;
642
+ type EnvironmentsInsightsBulkRestoreCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsBulkRestoreCreate>>;
643
+
644
+ const result: EnvironmentsInsightsBulkRestoreCreateOutput = await posthog.environmentsInsightsBulkRestoreCreate();
645
+
646
+ // Result shape (from schema): { restored: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }
647
+ ```
648
+
649
+ ### `posthog.environmentsInsightsBulkUpdateTagsCreate`
650
+
651
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/bulk_update_tags/`
652
+ - **What it does**: Bulk update tags on multiple objects.
653
+
654
+ PAT access: this action has no ``required_scopes=`` on the decorator —
655
+ inheriting viewsets must add ``"bulk_update_tags"`` to their
656
+ ``scope_object_write_actions`` list to accept personal API keys.
657
+ Without that opt-in, ``APIScopePermission`` rejects PAT requests with
658
+ "This action does not support personal API key access". Done per-viewset
659
+ so granting ``<scope>:write`` for one resource doesn't leak access to
660
+ sibling resources that share this mixin.
661
+
662
+ Accepts:
663
+ - {"ids": [...], "action": "add"|"remove"|"set", "tags": ["tag1", "tag2"]}
664
+
665
+ Actions:
666
+ - "add": Add tags to existing tags on each object
667
+ - "remove": Remove specific tags from each object
668
+ - "set": Replace all tags on each object with the provided list
669
+ - **OpenAPI operationId**: `environments_insights_bulk_update_tags_create`
670
+ - **Path params**: None
671
+ - **Query params**: `format`
672
+ - **Response codes**: `200`
673
+ - **Transport options**: None
674
+ - **TypeScript**: [Client interface](../types.ts)
675
+
676
+ **Inputs**
677
+
678
+ - Client input type: `{ [key: string]: unknown }`
679
+ - Client transport options: None
680
+
681
+ **Outputs**
682
+
683
+ - Client return type: `{ updated: ({ id: number; tags: (string)[] })[]; skipped: ({ id: number; reason: string })[] }`
684
+ - OpenAPI response codes: `200`
685
+
686
+ ```ts
687
+ import posthog from "@utdk/posthog";
688
+
689
+ type EnvironmentsInsightsBulkUpdateTagsCreateInput = Parameters<typeof posthog.environmentsInsightsBulkUpdateTagsCreate> extends [infer T, ...unknown[]] ? T : undefined;
690
+ type EnvironmentsInsightsBulkUpdateTagsCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsBulkUpdateTagsCreate>>;
691
+
692
+ const result: EnvironmentsInsightsBulkUpdateTagsCreateOutput = await posthog.environmentsInsightsBulkUpdateTagsCreate();
693
+
694
+ // Result shape (from schema): { updated: ({ id: number; tags: (string)[] })[]; skipped: ({ id: number; reason: string })[] }
695
+ ```
696
+
697
+ ### `posthog.environmentsInsightsCancelCreate`
698
+
699
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/cancel/`
700
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
701
+
702
+ The QueryCoalescingMiddleware attaches cached response data to
703
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
704
+ initial() (auth + permissions + throttling) before returning the
705
+ cached response, ensuring the request is authorized.
706
+ - **OpenAPI operationId**: `environments_insights_cancel_create`
707
+ - **Path params**: None
708
+ - **Query params**: `format`
709
+ - **Response codes**: `200`
710
+ - **Transport options**: None
711
+ - **TypeScript**: [Client interface](../types.ts)
712
+
713
+ **Inputs**
714
+
715
+ - Client input type: `{ [key: string]: unknown }`
716
+ - Client transport options: None
717
+
718
+ **Outputs**
719
+
720
+ - Client return type: `unknown`
721
+ - OpenAPI response codes: `200`
722
+
723
+ ```ts
724
+ import posthog from "@utdk/posthog";
725
+
726
+ type EnvironmentsInsightsCancelCreateInput = Parameters<typeof posthog.environmentsInsightsCancelCreate> extends [infer T, ...unknown[]] ? T : undefined;
727
+ type EnvironmentsInsightsCancelCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsCancelCreate>>;
728
+
729
+ const result: EnvironmentsInsightsCancelCreateOutput = await posthog.environmentsInsightsCancelCreate();
730
+
731
+ // Result shape (from schema): unknown
732
+ ```
733
+
734
+ ### `posthog.environmentsInsightsGenerateMetadataCreate`
735
+
736
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/generate_metadata/`
737
+ - **What it does**: Generate an AI-suggested name and description for an insight based on its query configuration.
738
+ - **OpenAPI operationId**: `environments_insights_generate_metadata_create`
739
+ - **Path params**: None
740
+ - **Query params**: `format`
741
+ - **Response codes**: `200`
742
+ - **Transport options**: None
743
+ - **TypeScript**: [Client interface](../types.ts)
744
+
745
+ **Inputs**
746
+
747
+ - Client input type: `{ [key: string]: unknown }`
748
+ - Client transport options: None
749
+
750
+ **Outputs**
751
+
752
+ - Client return type: `unknown`
753
+ - OpenAPI response codes: `200`
754
+
755
+ ```ts
756
+ import posthog from "@utdk/posthog";
757
+
758
+ type EnvironmentsInsightsGenerateMetadataCreateInput = Parameters<typeof posthog.environmentsInsightsGenerateMetadataCreate> extends [infer T, ...unknown[]] ? T : undefined;
759
+ type EnvironmentsInsightsGenerateMetadataCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsGenerateMetadataCreate>>;
760
+
761
+ const result: EnvironmentsInsightsGenerateMetadataCreateOutput = await posthog.environmentsInsightsGenerateMetadataCreate();
762
+
763
+ // Result shape (from schema): unknown
764
+ ```
765
+
766
+ ### `posthog.environmentsInsightsMyLastViewedRetrieve`
767
+
768
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/my_last_viewed/`
769
+ - **What it does**: Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
770
+ - **OpenAPI operationId**: `environments_insights_my_last_viewed_retrieve`
771
+ - **Path params**: None
772
+ - **Query params**: `format`
773
+ - **Response codes**: `200`
774
+ - **Transport options**: None
775
+ - **TypeScript**: [Client interface](../types.ts)
776
+
777
+ **Inputs**
778
+
779
+ - Client input type: `{ [key: string]: unknown }`
780
+ - Client transport options: None
781
+
782
+ **Outputs**
783
+
784
+ - Client return type: `unknown`
785
+ - OpenAPI response codes: `200`
786
+
787
+ ```ts
788
+ import posthog from "@utdk/posthog";
789
+
790
+ type EnvironmentsInsightsMyLastViewedRetrieveInput = Parameters<typeof posthog.environmentsInsightsMyLastViewedRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
791
+ type EnvironmentsInsightsMyLastViewedRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsMyLastViewedRetrieve>>;
792
+
793
+ const result: EnvironmentsInsightsMyLastViewedRetrieveOutput = await posthog.environmentsInsightsMyLastViewedRetrieve();
794
+
795
+ // Result shape (from schema): unknown
796
+ ```
797
+
798
+ ### `posthog.environmentsInsightsTrendingRetrieve`
799
+
800
+ - **HTTP**: `GET /api/environments/{environment_id}/insights/trending/`
801
+ - **What it does**: Returns insights ranked by view count over the last N days (default 7), highest first. Each result includes the same metadata as the standard insights list, plus a `view_count` and up to 3 recent `viewers`. Useful for surfacing the most-used insights in a project.
802
+ - **OpenAPI operationId**: `environments_insights_trending_retrieve`
803
+ - **Path params**: None
804
+ - **Query params**: `days`, `format`, `limit`, `offset`
805
+ - **Response codes**: `200`
806
+ - **Transport options**: None
807
+ - **TypeScript**: [Client interface](../types.ts)
808
+
809
+ **Inputs**
810
+
811
+ - Client input type: `{ [key: string]: unknown }`
812
+ - Client transport options: None
813
+
814
+ **Outputs**
815
+
816
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: unknown; dashboards: (number)[]; dashboard_tiles: ({...`
817
+ - OpenAPI response codes: `200`
818
+
819
+ ```ts
820
+ import posthog from "@utdk/posthog";
821
+
822
+ type EnvironmentsInsightsTrendingRetrieveInput = Parameters<typeof posthog.environmentsInsightsTrendingRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
823
+ type EnvironmentsInsightsTrendingRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsTrendingRetrieve>>;
824
+
825
+ const result: EnvironmentsInsightsTrendingRetrieveOutput = await posthog.environmentsInsightsTrendingRetrieve();
826
+
827
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: unknown; dashboards: (number)[]; dashboard_tiles: ({...
828
+ ```
829
+
830
+ ### `posthog.environmentsInsightsViewedCreate`
831
+
832
+ - **HTTP**: `POST /api/environments/{environment_id}/insights/viewed/`
833
+ - **What it does**: Record that the current user has just viewed one or more insights. Submitted ids that do not belong to the current project or that point at deleted insights are silently dropped. Returns 201 on success regardless of how many ids were retained.
834
+ - **OpenAPI operationId**: `environments_insights_viewed_create`
835
+ - **Path params**: None
836
+ - **Query params**: `format`
837
+ - **Response codes**: `201`
838
+ - **Transport options**: None
839
+ - **TypeScript**: [Client interface](../types.ts)
840
+
841
+ **Inputs**
842
+
843
+ - Client input type: `{ [key: string]: unknown }`
844
+ - Client transport options: None
845
+
846
+ **Outputs**
847
+
848
+ - Client return type: `unknown`
849
+ - OpenAPI response codes: `201`
850
+
851
+ ```ts
852
+ import posthog from "@utdk/posthog";
853
+
854
+ type EnvironmentsInsightsViewedCreateInput = Parameters<typeof posthog.environmentsInsightsViewedCreate> extends [infer T, ...unknown[]] ? T : undefined;
855
+ type EnvironmentsInsightsViewedCreateOutput = Awaited<ReturnType<typeof posthog.environmentsInsightsViewedCreate>>;
856
+
857
+ const result: EnvironmentsInsightsViewedCreateOutput = await posthog.environmentsInsightsViewedCreate();
858
+
859
+ // Result shape (from schema): unknown
860
+ ```
861
+
862
+ ### `posthog.insightsList`
863
+
864
+ - **HTTP**: `GET /api/projects/{project_id}/insights/`
865
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
866
+
867
+ The QueryCoalescingMiddleware attaches cached response data to
868
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
869
+ initial() (auth + permissions + throttling) before returning the
870
+ cached response, ensuring the request is authorized.
871
+ - **OpenAPI operationId**: `insights_list`
872
+ - **Path params**: None
873
+ - **Query params**: `basic`, `created_by`, `created_date_from`, `created_date_to`, `dashboards`, `date_from`, `date_to`, `favorited`, `format`, `insight`, `last_viewed_date_from`, `last_viewed_date_to`, `limit`, `offset`, `refresh`, `saved`, `search`, `short_id`, `tags`, `user`
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: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; ...`
886
+ - OpenAPI response codes: `200`
887
+
888
+ ```ts
889
+ import posthog from "@utdk/posthog";
890
+
891
+ type InsightsListInput = Parameters<typeof posthog.insightsList> extends [infer T, ...unknown[]] ? T : undefined;
892
+ type InsightsListOutput = Awaited<ReturnType<typeof posthog.insightsList>>;
893
+
894
+ const result: InsightsListOutput = await posthog.insightsList();
895
+
896
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; ...
897
+ ```
898
+
899
+ ### `posthog.insightsCreate`
900
+
901
+ - **HTTP**: `POST /api/projects/{project_id}/insights/`
902
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
903
+
904
+ The QueryCoalescingMiddleware attaches cached response data to
905
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
906
+ initial() (auth + permissions + throttling) before returning the
907
+ cached response, ensuring the request is authorized.
908
+ - **OpenAPI operationId**: `insights_create`
909
+ - **Path params**: None
910
+ - **Query params**: `format`
911
+ - **Response codes**: `201`
912
+ - **Transport options**: None
913
+ - **TypeScript**: [Client interface](../types.ts)
914
+
915
+ **Inputs**
916
+
917
+ - Client input type: `{ [key: string]: unknown }`
918
+ - Client transport options: None
919
+
920
+ **Outputs**
921
+
922
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
923
+ - OpenAPI response codes: `201`
924
+
925
+ ```ts
926
+ import posthog from "@utdk/posthog";
927
+
928
+ type InsightsCreateInput = Parameters<typeof posthog.insightsCreate> extends [infer T, ...unknown[]] ? T : undefined;
929
+ type InsightsCreateOutput = Awaited<ReturnType<typeof posthog.insightsCreate>>;
930
+
931
+ const result: InsightsCreateOutput = await posthog.insightsCreate();
932
+
933
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
934
+ ```
935
+
936
+ ### `posthog.insightsDestroy`
937
+
938
+ - **HTTP**: `DELETE /api/projects/{project_id}/insights/{id}/`
939
+ - **What it does**: Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
940
+ - **OpenAPI operationId**: `insights_destroy`
941
+ - **Path params**: `id`
942
+ - **Query params**: `format`
943
+ - **Response codes**: `405`
944
+ - **Transport options**: None
945
+ - **TypeScript**: [Client interface](../types.ts)
946
+
947
+ **Inputs**
948
+
949
+ - Client input type: `{ [key: string]: unknown }`
950
+ - Client transport options: None
951
+
952
+ **Outputs**
953
+
954
+ - Client return type: `unknown`
955
+ - OpenAPI response codes: `405`
956
+
957
+ ```ts
958
+ import posthog from "@utdk/posthog";
959
+
960
+ type InsightsDestroyInput = Parameters<typeof posthog.insightsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
961
+ type InsightsDestroyOutput = Awaited<ReturnType<typeof posthog.insightsDestroy>>;
962
+
963
+ const result: InsightsDestroyOutput = await posthog.insightsDestroy();
964
+
965
+ // Result shape (from schema): unknown
966
+ ```
967
+
968
+ ### `posthog.insightsRetrieve`
969
+
970
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{id}/`
971
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
972
+
973
+ The QueryCoalescingMiddleware attaches cached response data to
974
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
975
+ initial() (auth + permissions + throttling) before returning the
976
+ cached response, ensuring the request is authorized.
977
+ - **OpenAPI operationId**: `insights_retrieve`
978
+ - **Path params**: `id`
979
+ - **Query params**: `filters_override`, `format`, `from_dashboard`, `refresh`, `variables_override`
980
+ - **Response codes**: `200`
981
+ - **Transport options**: None
982
+ - **TypeScript**: [Client interface](../types.ts)
983
+
984
+ **Inputs**
985
+
986
+ - Client input type: `{ [key: string]: unknown }`
987
+ - Client transport options: None
988
+
989
+ **Outputs**
990
+
991
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
992
+ - OpenAPI response codes: `200`
993
+
994
+ ```ts
995
+ import posthog from "@utdk/posthog";
996
+
997
+ type InsightsRetrieveInput = Parameters<typeof posthog.insightsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
998
+ type InsightsRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsRetrieve>>;
999
+
1000
+ const result: InsightsRetrieveOutput = await posthog.insightsRetrieve();
1001
+
1002
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
1003
+ ```
1004
+
1005
+ ### `posthog.insightsPartialUpdate`
1006
+
1007
+ - **HTTP**: `PATCH /api/projects/{project_id}/insights/{id}/`
1008
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
1009
+
1010
+ The QueryCoalescingMiddleware attaches cached response data to
1011
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
1012
+ initial() (auth + permissions + throttling) before returning the
1013
+ cached response, ensuring the request is authorized.
1014
+ - **OpenAPI operationId**: `insights_partial_update`
1015
+ - **Path params**: `id`
1016
+ - **Query params**: `format`
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: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
1029
+ - OpenAPI response codes: `200`
1030
+
1031
+ ```ts
1032
+ import posthog from "@utdk/posthog";
1033
+
1034
+ type InsightsPartialUpdateInput = Parameters<typeof posthog.insightsPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
1035
+ type InsightsPartialUpdateOutput = Awaited<ReturnType<typeof posthog.insightsPartialUpdate>>;
1036
+
1037
+ const result: InsightsPartialUpdateOutput = await posthog.insightsPartialUpdate();
1038
+
1039
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
1040
+ ```
1041
+
1042
+ ### `posthog.insightsUpdate`
1043
+
1044
+ - **HTTP**: `PUT /api/projects/{project_id}/insights/{id}/`
1045
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
1046
+
1047
+ The QueryCoalescingMiddleware attaches cached response data to
1048
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
1049
+ initial() (auth + permissions + throttling) before returning the
1050
+ cached response, ensuring the request is authorized.
1051
+ - **OpenAPI operationId**: `insights_update`
1052
+ - **Path params**: `id`
1053
+ - **Query params**: `format`
1054
+ - **Response codes**: `200`
1055
+ - **Transport options**: None
1056
+ - **TypeScript**: [Client interface](../types.ts)
1057
+
1058
+ **Inputs**
1059
+
1060
+ - Client input type: `{ [key: string]: unknown }`
1061
+ - Client transport options: None
1062
+
1063
+ **Outputs**
1064
+
1065
+ - Client return type: `{ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...`
1066
+ - OpenAPI response codes: `200`
1067
+
1068
+ ```ts
1069
+ import posthog from "@utdk/posthog";
1070
+
1071
+ type InsightsUpdateInput = Parameters<typeof posthog.insightsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
1072
+ type InsightsUpdateOutput = Awaited<ReturnType<typeof posthog.insightsUpdate>>;
1073
+
1074
+ const result: InsightsUpdateOutput = await posthog.insightsUpdate();
1075
+
1076
+ // Result shape (from schema): { id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: { embedded?: boolean | null; full?: boolean | null; hidePersonsModal?: boolean | null; hideTooltipOnScroll?: boolean | null; ki...
1077
+ ```
1078
+
1079
+ ### `posthog.insightsActivityRetrieve`
1080
+
1081
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{id}/activity/`
1082
+ - **What it does**: Audit trail for a single insight — every change made to it, by whom, and when. Use this when you want the change history of a specific insight; use the project-wide activity endpoint for a broader view.
1083
+ - **OpenAPI operationId**: `insights_activity_retrieve`
1084
+ - **Path params**: `id`
1085
+ - **Query params**: `format`, `limit`, `page`
1086
+ - **Response codes**: `200`
1087
+ - **Transport options**: None
1088
+ - **TypeScript**: [Client interface](../types.ts)
1089
+
1090
+ **Inputs**
1091
+
1092
+ - Client input type: `{ [key: string]: unknown }`
1093
+ - Client transport options: None
1094
+
1095
+ **Outputs**
1096
+
1097
+ - Client return type: `{ results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...`
1098
+ - OpenAPI response codes: `200`
1099
+
1100
+ ```ts
1101
+ import posthog from "@utdk/posthog";
1102
+
1103
+ type InsightsActivityRetrieveInput = Parameters<typeof posthog.insightsActivityRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1104
+ type InsightsActivityRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsActivityRetrieve>>;
1105
+
1106
+ const result: InsightsActivityRetrieveOutput = await posthog.insightsActivityRetrieve();
1107
+
1108
+ // Result shape (from schema): { results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...
1109
+ ```
1110
+
1111
+ ### `posthog.insightsAnalyzeRetrieve`
1112
+
1113
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{id}/analyze/`
1114
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
1115
+
1116
+ The QueryCoalescingMiddleware attaches cached response data to
1117
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
1118
+ initial() (auth + permissions + throttling) before returning the
1119
+ cached response, ensuring the request is authorized.
1120
+ - **OpenAPI operationId**: `insights_analyze_retrieve`
1121
+ - **Path params**: `id`
1122
+ - **Query params**: `format`
1123
+ - **Response codes**: `200`
1124
+ - **Transport options**: None
1125
+ - **TypeScript**: [Client interface](../types.ts)
1126
+
1127
+ **Inputs**
1128
+
1129
+ - Client input type: `{ [key: string]: unknown }`
1130
+ - Client transport options: None
1131
+
1132
+ **Outputs**
1133
+
1134
+ - Client return type: `unknown`
1135
+ - OpenAPI response codes: `200`
1136
+
1137
+ ```ts
1138
+ import posthog from "@utdk/posthog";
1139
+
1140
+ type InsightsAnalyzeRetrieveInput = Parameters<typeof posthog.insightsAnalyzeRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1141
+ type InsightsAnalyzeRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsAnalyzeRetrieve>>;
1142
+
1143
+ const result: InsightsAnalyzeRetrieveOutput = await posthog.insightsAnalyzeRetrieve();
1144
+
1145
+ // Result shape (from schema): unknown
1146
+ ```
1147
+
1148
+ ### `posthog.insightsSuggestionsRetrieve`
1149
+
1150
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{id}/suggestions/`
1151
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
1152
+
1153
+ The QueryCoalescingMiddleware attaches cached response data to
1154
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
1155
+ initial() (auth + permissions + throttling) before returning the
1156
+ cached response, ensuring the request is authorized.
1157
+ - **OpenAPI operationId**: `insights_suggestions_retrieve`
1158
+ - **Path params**: `id`
1159
+ - **Query params**: `format`
1160
+ - **Response codes**: `200`
1161
+ - **Transport options**: None
1162
+ - **TypeScript**: [Client interface](../types.ts)
1163
+
1164
+ **Inputs**
1165
+
1166
+ - Client input type: `{ [key: string]: unknown }`
1167
+ - Client transport options: None
1168
+
1169
+ **Outputs**
1170
+
1171
+ - Client return type: `unknown`
1172
+ - OpenAPI response codes: `200`
1173
+
1174
+ ```ts
1175
+ import posthog from "@utdk/posthog";
1176
+
1177
+ type InsightsSuggestionsRetrieveInput = Parameters<typeof posthog.insightsSuggestionsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1178
+ type InsightsSuggestionsRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsSuggestionsRetrieve>>;
1179
+
1180
+ const result: InsightsSuggestionsRetrieveOutput = await posthog.insightsSuggestionsRetrieve();
1181
+
1182
+ // Result shape (from schema): unknown
1183
+ ```
1184
+
1185
+ ### `posthog.insightsSuggestionsCreate`
1186
+
1187
+ - **HTTP**: `POST /api/projects/{project_id}/insights/{id}/suggestions/`
1188
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
1189
+
1190
+ The QueryCoalescingMiddleware attaches cached response data to
1191
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
1192
+ initial() (auth + permissions + throttling) before returning the
1193
+ cached response, ensuring the request is authorized.
1194
+ - **OpenAPI operationId**: `insights_suggestions_create`
1195
+ - **Path params**: `id`
1196
+ - **Query params**: `format`
1197
+ - **Response codes**: `200`
1198
+ - **Transport options**: None
1199
+ - **TypeScript**: [Client interface](../types.ts)
1200
+
1201
+ **Inputs**
1202
+
1203
+ - Client input type: `{ [key: string]: unknown }`
1204
+ - Client transport options: None
1205
+
1206
+ **Outputs**
1207
+
1208
+ - Client return type: `unknown`
1209
+ - OpenAPI response codes: `200`
1210
+
1211
+ ```ts
1212
+ import posthog from "@utdk/posthog";
1213
+
1214
+ type InsightsSuggestionsCreateInput = Parameters<typeof posthog.insightsSuggestionsCreate> extends [infer T, ...unknown[]] ? T : undefined;
1215
+ type InsightsSuggestionsCreateOutput = Awaited<ReturnType<typeof posthog.insightsSuggestionsCreate>>;
1216
+
1217
+ const result: InsightsSuggestionsCreateOutput = await posthog.insightsSuggestionsCreate();
1218
+
1219
+ // Result shape (from schema): unknown
1220
+ ```
1221
+
1222
+ ### `posthog.insightsSharingList`
1223
+
1224
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{insight_id}/sharing/`
1225
+ - **OpenAPI operationId**: `insights_sharing_list`
1226
+ - **Path params**: `insight_id`
1227
+ - **Query params**: None
1228
+ - **Response codes**: `200`
1229
+ - **Transport options**: None
1230
+ - **TypeScript**: [Client interface](../types.ts)
1231
+
1232
+ **Inputs**
1233
+
1234
+ - Client input type: `{ [key: string]: unknown }`
1235
+ - Client transport options: None
1236
+
1237
+ **Outputs**
1238
+
1239
+ - Client return type: `({ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string;...`
1240
+ - OpenAPI response codes: `200`
1241
+
1242
+ ```ts
1243
+ import posthog from "@utdk/posthog";
1244
+
1245
+ type InsightsSharingListInput = Parameters<typeof posthog.insightsSharingList> extends [infer T, ...unknown[]] ? T : undefined;
1246
+ type InsightsSharingListOutput = Awaited<ReturnType<typeof posthog.insightsSharingList>>;
1247
+
1248
+ const result: InsightsSharingListOutput = await posthog.insightsSharingList();
1249
+
1250
+ // Result shape (from schema): ({ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string;...
1251
+ ```
1252
+
1253
+ ### `posthog.insightsSharingPasswordsCreate`
1254
+
1255
+ - **HTTP**: `POST /api/projects/{project_id}/insights/{insight_id}/sharing/passwords/`
1256
+ - **What it does**: Create a new password for the sharing configuration.
1257
+ - **OpenAPI operationId**: `insights_sharing_passwords_create`
1258
+ - **Path params**: `insight_id`
1259
+ - **Query params**: None
1260
+ - **Response codes**: `200`
1261
+ - **Transport options**: None
1262
+ - **TypeScript**: [Client interface](../types.ts)
1263
+
1264
+ **Inputs**
1265
+
1266
+ - Client input type: `{ [key: string]: unknown }`
1267
+ - Client transport options: None
1268
+
1269
+ **Outputs**
1270
+
1271
+ - Client return type: `{ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...`
1272
+ - OpenAPI response codes: `200`
1273
+
1274
+ ```ts
1275
+ import posthog from "@utdk/posthog";
1276
+
1277
+ type InsightsSharingPasswordsCreateInput = Parameters<typeof posthog.insightsSharingPasswordsCreate> extends [infer T, ...unknown[]] ? T : undefined;
1278
+ type InsightsSharingPasswordsCreateOutput = Awaited<ReturnType<typeof posthog.insightsSharingPasswordsCreate>>;
1279
+
1280
+ const result: InsightsSharingPasswordsCreateOutput = await posthog.insightsSharingPasswordsCreate();
1281
+
1282
+ // Result shape (from schema): { created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...
1283
+ ```
1284
+
1285
+ ### `posthog.insightsSharingPasswordsDestroy`
1286
+
1287
+ - **HTTP**: `DELETE /api/projects/{project_id}/insights/{insight_id}/sharing/passwords/{password_id}/`
1288
+ - **What it does**: Delete a password from the sharing configuration.
1289
+ - **OpenAPI operationId**: `insights_sharing_passwords_destroy`
1290
+ - **Path params**: `insight_id`, `password_id`
1291
+ - **Query params**: None
1292
+ - **Response codes**: `204`
1293
+ - **Transport options**: None
1294
+ - **TypeScript**: [Client interface](../types.ts)
1295
+
1296
+ **Inputs**
1297
+
1298
+ - Client input type: `{ [key: string]: unknown }`
1299
+ - Client transport options: None
1300
+
1301
+ **Outputs**
1302
+
1303
+ - Client return type: `unknown`
1304
+ - OpenAPI response codes: `204`
1305
+
1306
+ ```ts
1307
+ import posthog from "@utdk/posthog";
1308
+
1309
+ type InsightsSharingPasswordsDestroyInput = Parameters<typeof posthog.insightsSharingPasswordsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
1310
+ type InsightsSharingPasswordsDestroyOutput = Awaited<ReturnType<typeof posthog.insightsSharingPasswordsDestroy>>;
1311
+
1312
+ const result: InsightsSharingPasswordsDestroyOutput = await posthog.insightsSharingPasswordsDestroy();
1313
+
1314
+ // Result shape (from schema): unknown
1315
+ ```
1316
+
1317
+ ### `posthog.insightsSharingRefreshCreate`
1318
+
1319
+ - **HTTP**: `POST /api/projects/{project_id}/insights/{insight_id}/sharing/refresh/`
1320
+ - **OpenAPI operationId**: `insights_sharing_refresh_create`
1321
+ - **Path params**: `insight_id`
1322
+ - **Query params**: None
1323
+ - **Response codes**: `200`
1324
+ - **Transport options**: None
1325
+ - **TypeScript**: [Client interface](../types.ts)
1326
+
1327
+ **Inputs**
1328
+
1329
+ - Client input type: `{ [key: string]: unknown }`
1330
+ - Client transport options: None
1331
+
1332
+ **Outputs**
1333
+
1334
+ - Client return type: `{ created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...`
1335
+ - OpenAPI response codes: `200`
1336
+
1337
+ ```ts
1338
+ import posthog from "@utdk/posthog";
1339
+
1340
+ type InsightsSharingRefreshCreateInput = Parameters<typeof posthog.insightsSharingRefreshCreate> extends [infer T, ...unknown[]] ? T : undefined;
1341
+ type InsightsSharingRefreshCreateOutput = Awaited<ReturnType<typeof posthog.insightsSharingRefreshCreate>>;
1342
+
1343
+ const result: InsightsSharingRefreshCreateOutput = await posthog.insightsSharingRefreshCreate();
1344
+
1345
+ // Result shape (from schema): { created_at: string; enabled?: boolean; access_token: string | null; settings?: unknown; password_required?: boolean; share_passwords: ({ id: number; created_at: string; note?: string | null; created_by_email: string; ...
1346
+ ```
1347
+
1348
+ ### `posthog.insightsThresholdsList`
1349
+
1350
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{insight_id}/thresholds/`
1351
+ - **OpenAPI operationId**: `insights_thresholds_list`
1352
+ - **Path params**: `insight_id`
1353
+ - **Query params**: `limit`, `offset`
1354
+ - **Response codes**: `200`
1355
+ - **Transport options**: None
1356
+ - **TypeScript**: [Client interface](../types.ts)
1357
+
1358
+ **Inputs**
1359
+
1360
+ - Client input type: `{ [key: string]: unknown }`
1361
+ - Client transport options: None
1362
+
1363
+ **Outputs**
1364
+
1365
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absol...`
1366
+ - OpenAPI response codes: `200`
1367
+
1368
+ ```ts
1369
+ import posthog from "@utdk/posthog";
1370
+
1371
+ type InsightsThresholdsListInput = Parameters<typeof posthog.insightsThresholdsList> extends [infer T, ...unknown[]] ? T : undefined;
1372
+ type InsightsThresholdsListOutput = Awaited<ReturnType<typeof posthog.insightsThresholdsList>>;
1373
+
1374
+ const result: InsightsThresholdsListOutput = await posthog.insightsThresholdsList();
1375
+
1376
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absol...
1377
+ ```
1378
+
1379
+ ### `posthog.insightsThresholdsRetrieve`
1380
+
1381
+ - **HTTP**: `GET /api/projects/{project_id}/insights/{insight_id}/thresholds/{id}/`
1382
+ - **OpenAPI operationId**: `insights_thresholds_retrieve`
1383
+ - **Path params**: `id`, `insight_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: `{ id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absolute" | "percentage" }; alerts: ({ id: string; created_by: { id: number; uui...`
1397
+ - OpenAPI response codes: `200`
1398
+
1399
+ ```ts
1400
+ import posthog from "@utdk/posthog";
1401
+
1402
+ type InsightsThresholdsRetrieveInput = Parameters<typeof posthog.insightsThresholdsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1403
+ type InsightsThresholdsRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsThresholdsRetrieve>>;
1404
+
1405
+ const result: InsightsThresholdsRetrieveOutput = await posthog.insightsThresholdsRetrieve();
1406
+
1407
+ // Result shape (from schema): { id: string; created_at: string; name?: string; configuration: { bounds?: { lower?: number | null; upper?: number | null } | null; type: "absolute" | "percentage" }; alerts: ({ id: string; created_by: { id: number; uui...
1408
+ ```
1409
+
1410
+ ### `posthog.insightsAllActivityRetrieve`
1411
+
1412
+ - **HTTP**: `GET /api/projects/{project_id}/insights/activity/`
1413
+ - **What it does**: Project-wide audit trail across all insights — who created, edited, deleted, or restored insights, what changed (with before/after diffs), and when. Useful for surfacing what people (or agents) have been working on recently.
1414
+ - **OpenAPI operationId**: `insights_all_activity_retrieve`
1415
+ - **Path params**: None
1416
+ - **Query params**: `format`, `limit`, `page`
1417
+ - **Response codes**: `200`
1418
+ - **Transport options**: None
1419
+ - **TypeScript**: [Client interface](../types.ts)
1420
+
1421
+ **Inputs**
1422
+
1423
+ - Client input type: `{ [key: string]: unknown }`
1424
+ - Client transport options: None
1425
+
1426
+ **Outputs**
1427
+
1428
+ - Client return type: `{ results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...`
1429
+ - OpenAPI response codes: `200`
1430
+
1431
+ ```ts
1432
+ import posthog from "@utdk/posthog";
1433
+
1434
+ type InsightsAllActivityRetrieveInput = Parameters<typeof posthog.insightsAllActivityRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1435
+ type InsightsAllActivityRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsAllActivityRetrieve>>;
1436
+
1437
+ const result: InsightsAllActivityRetrieveOutput = await posthog.insightsAllActivityRetrieve();
1438
+
1439
+ // Result shape (from schema): { results: ({ id: string; user: { [key: string]: unknown } | null; activity: string; scope: string; item_id: string; detail?: { id: string; changes?: ({ type: string; action: string; field: string; before: unknown; afte...
1440
+ ```
1441
+
1442
+ ### `posthog.insightsBulkDeleteCreate`
1443
+
1444
+ - **HTTP**: `POST /api/projects/{project_id}/insights/bulk_delete/`
1445
+ - **What it does**: Soft-delete insights in bulk by ID. Mirrors the single-insight delete: sets deleted=True, soft-deletes the insights' dashboard tiles, and removes their linked alerts. Insights the requester cannot edit are skipped and reported in `skipped`. Reversible via the bulk_restore endpoint.
1446
+ - **OpenAPI operationId**: `insights_bulk_delete_create`
1447
+ - **Path params**: None
1448
+ - **Query params**: `format`
1449
+ - **Response codes**: `200`
1450
+ - **Transport options**: None
1451
+ - **TypeScript**: [Client interface](../types.ts)
1452
+
1453
+ **Inputs**
1454
+
1455
+ - Client input type: `{ [key: string]: unknown }`
1456
+ - Client transport options: None
1457
+
1458
+ **Outputs**
1459
+
1460
+ - Client return type: `{ deleted: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }`
1461
+ - OpenAPI response codes: `200`
1462
+
1463
+ ```ts
1464
+ import posthog from "@utdk/posthog";
1465
+
1466
+ type InsightsBulkDeleteCreateInput = Parameters<typeof posthog.insightsBulkDeleteCreate> extends [infer T, ...unknown[]] ? T : undefined;
1467
+ type InsightsBulkDeleteCreateOutput = Awaited<ReturnType<typeof posthog.insightsBulkDeleteCreate>>;
1468
+
1469
+ const result: InsightsBulkDeleteCreateOutput = await posthog.insightsBulkDeleteCreate();
1470
+
1471
+ // Result shape (from schema): { deleted: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }
1472
+ ```
1473
+
1474
+ ### `posthog.insightsBulkRestoreCreate`
1475
+
1476
+ - **HTTP**: `POST /api/projects/{project_id}/insights/bulk_restore/`
1477
+ - **What it does**: Restore soft-deleted insights in bulk by ID — the inverse of bulk_delete. Sets deleted=False and re-activates the insights' dashboard tiles on dashboards that still exist. Linked alerts are not restored (they are removed on delete). Insights the requester cannot edit are reported in `skipped`.
1478
+ - **OpenAPI operationId**: `insights_bulk_restore_create`
1479
+ - **Path params**: None
1480
+ - **Query params**: `format`
1481
+ - **Response codes**: `200`
1482
+ - **Transport options**: None
1483
+ - **TypeScript**: [Client interface](../types.ts)
1484
+
1485
+ **Inputs**
1486
+
1487
+ - Client input type: `{ [key: string]: unknown }`
1488
+ - Client transport options: None
1489
+
1490
+ **Outputs**
1491
+
1492
+ - Client return type: `{ restored: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }`
1493
+ - OpenAPI response codes: `200`
1494
+
1495
+ ```ts
1496
+ import posthog from "@utdk/posthog";
1497
+
1498
+ type InsightsBulkRestoreCreateInput = Parameters<typeof posthog.insightsBulkRestoreCreate> extends [infer T, ...unknown[]] ? T : undefined;
1499
+ type InsightsBulkRestoreCreateOutput = Awaited<ReturnType<typeof posthog.insightsBulkRestoreCreate>>;
1500
+
1501
+ const result: InsightsBulkRestoreCreateOutput = await posthog.insightsBulkRestoreCreate();
1502
+
1503
+ // Result shape (from schema): { restored: ({ id: number; name: string | null })[]; skipped: ({ id: number; reason: string })[] }
1504
+ ```
1505
+
1506
+ ### `posthog.insightsBulkUpdateTagsCreate`
1507
+
1508
+ - **HTTP**: `POST /api/projects/{project_id}/insights/bulk_update_tags/`
1509
+ - **What it does**: Bulk update tags on multiple objects.
1510
+
1511
+ PAT access: this action has no ``required_scopes=`` on the decorator —
1512
+ inheriting viewsets must add ``"bulk_update_tags"`` to their
1513
+ ``scope_object_write_actions`` list to accept personal API keys.
1514
+ Without that opt-in, ``APIScopePermission`` rejects PAT requests with
1515
+ "This action does not support personal API key access". Done per-viewset
1516
+ so granting ``<scope>:write`` for one resource doesn't leak access to
1517
+ sibling resources that share this mixin.
1518
+
1519
+ Accepts:
1520
+ - {"ids": [...], "action": "add"|"remove"|"set", "tags": ["tag1", "tag2"]}
1521
+
1522
+ Actions:
1523
+ - "add": Add tags to existing tags on each object
1524
+ - "remove": Remove specific tags from each object
1525
+ - "set": Replace all tags on each object with the provided list
1526
+ - **OpenAPI operationId**: `insights_bulk_update_tags_create`
1527
+ - **Path params**: None
1528
+ - **Query params**: `format`
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: `{ updated: ({ id: number; tags: (string)[] })[]; skipped: ({ id: number; reason: string })[] }`
1541
+ - OpenAPI response codes: `200`
1542
+
1543
+ ```ts
1544
+ import posthog from "@utdk/posthog";
1545
+
1546
+ type InsightsBulkUpdateTagsCreateInput = Parameters<typeof posthog.insightsBulkUpdateTagsCreate> extends [infer T, ...unknown[]] ? T : undefined;
1547
+ type InsightsBulkUpdateTagsCreateOutput = Awaited<ReturnType<typeof posthog.insightsBulkUpdateTagsCreate>>;
1548
+
1549
+ const result: InsightsBulkUpdateTagsCreateOutput = await posthog.insightsBulkUpdateTagsCreate();
1550
+
1551
+ // Result shape (from schema): { updated: ({ id: number; tags: (string)[] })[]; skipped: ({ id: number; reason: string })[] }
1552
+ ```
1553
+
1554
+ ### `posthog.insightsCancelCreate`
1555
+
1556
+ - **HTTP**: `POST /api/projects/{project_id}/insights/cancel/`
1557
+ - **What it does**: DRF ViewSet mixin that gates coalesced responses behind permission checks.
1558
+
1559
+ The QueryCoalescingMiddleware attaches cached response data to
1560
+ request.META["_coalesced_response"] for followers. This mixin runs DRF's
1561
+ initial() (auth + permissions + throttling) before returning the
1562
+ cached response, ensuring the request is authorized.
1563
+ - **OpenAPI operationId**: `insights_cancel_create`
1564
+ - **Path params**: None
1565
+ - **Query params**: `format`
1566
+ - **Response codes**: `200`
1567
+ - **Transport options**: None
1568
+ - **TypeScript**: [Client interface](../types.ts)
1569
+
1570
+ **Inputs**
1571
+
1572
+ - Client input type: `{ [key: string]: unknown }`
1573
+ - Client transport options: None
1574
+
1575
+ **Outputs**
1576
+
1577
+ - Client return type: `unknown`
1578
+ - OpenAPI response codes: `200`
1579
+
1580
+ ```ts
1581
+ import posthog from "@utdk/posthog";
1582
+
1583
+ type InsightsCancelCreateInput = Parameters<typeof posthog.insightsCancelCreate> extends [infer T, ...unknown[]] ? T : undefined;
1584
+ type InsightsCancelCreateOutput = Awaited<ReturnType<typeof posthog.insightsCancelCreate>>;
1585
+
1586
+ const result: InsightsCancelCreateOutput = await posthog.insightsCancelCreate();
1587
+
1588
+ // Result shape (from schema): unknown
1589
+ ```
1590
+
1591
+ ### `posthog.insightsGenerateMetadataCreate`
1592
+
1593
+ - **HTTP**: `POST /api/projects/{project_id}/insights/generate_metadata/`
1594
+ - **What it does**: Generate an AI-suggested name and description for an insight based on its query configuration.
1595
+ - **OpenAPI operationId**: `insights_generate_metadata_create`
1596
+ - **Path params**: None
1597
+ - **Query params**: `format`
1598
+ - **Response codes**: `200`
1599
+ - **Transport options**: None
1600
+ - **TypeScript**: [Client interface](../types.ts)
1601
+
1602
+ **Inputs**
1603
+
1604
+ - Client input type: `{ [key: string]: unknown }`
1605
+ - Client transport options: None
1606
+
1607
+ **Outputs**
1608
+
1609
+ - Client return type: `unknown`
1610
+ - OpenAPI response codes: `200`
1611
+
1612
+ ```ts
1613
+ import posthog from "@utdk/posthog";
1614
+
1615
+ type InsightsGenerateMetadataCreateInput = Parameters<typeof posthog.insightsGenerateMetadataCreate> extends [infer T, ...unknown[]] ? T : undefined;
1616
+ type InsightsGenerateMetadataCreateOutput = Awaited<ReturnType<typeof posthog.insightsGenerateMetadataCreate>>;
1617
+
1618
+ const result: InsightsGenerateMetadataCreateOutput = await posthog.insightsGenerateMetadataCreate();
1619
+
1620
+ // Result shape (from schema): unknown
1621
+ ```
1622
+
1623
+ ### `posthog.insightsMyLastViewedRetrieve`
1624
+
1625
+ - **HTTP**: `GET /api/projects/{project_id}/insights/my_last_viewed/`
1626
+ - **What it does**: Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
1627
+ - **OpenAPI operationId**: `insights_my_last_viewed_retrieve`
1628
+ - **Path params**: None
1629
+ - **Query params**: `format`
1630
+ - **Response codes**: `200`
1631
+ - **Transport options**: None
1632
+ - **TypeScript**: [Client interface](../types.ts)
1633
+
1634
+ **Inputs**
1635
+
1636
+ - Client input type: `{ [key: string]: unknown }`
1637
+ - Client transport options: None
1638
+
1639
+ **Outputs**
1640
+
1641
+ - Client return type: `unknown`
1642
+ - OpenAPI response codes: `200`
1643
+
1644
+ ```ts
1645
+ import posthog from "@utdk/posthog";
1646
+
1647
+ type InsightsMyLastViewedRetrieveInput = Parameters<typeof posthog.insightsMyLastViewedRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1648
+ type InsightsMyLastViewedRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsMyLastViewedRetrieve>>;
1649
+
1650
+ const result: InsightsMyLastViewedRetrieveOutput = await posthog.insightsMyLastViewedRetrieve();
1651
+
1652
+ // Result shape (from schema): unknown
1653
+ ```
1654
+
1655
+ ### `posthog.insightsTrendingRetrieve`
1656
+
1657
+ - **HTTP**: `GET /api/projects/{project_id}/insights/trending/`
1658
+ - **What it does**: Returns insights ranked by view count over the last N days (default 7), highest first. Each result includes the same metadata as the standard insights list, plus a `view_count` and up to 3 recent `viewers`. Useful for surfacing the most-used insights in a project.
1659
+ - **OpenAPI operationId**: `insights_trending_retrieve`
1660
+ - **Path params**: None
1661
+ - **Query params**: `days`, `format`, `limit`, `offset`
1662
+ - **Response codes**: `200`
1663
+ - **Transport options**: None
1664
+ - **TypeScript**: [Client interface](../types.ts)
1665
+
1666
+ **Inputs**
1667
+
1668
+ - Client input type: `{ [key: string]: unknown }`
1669
+ - Client transport options: None
1670
+
1671
+ **Outputs**
1672
+
1673
+ - Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: unknown; dashboards: (number)[]; dashboard_tiles: ({...`
1674
+ - OpenAPI response codes: `200`
1675
+
1676
+ ```ts
1677
+ import posthog from "@utdk/posthog";
1678
+
1679
+ type InsightsTrendingRetrieveInput = Parameters<typeof posthog.insightsTrendingRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
1680
+ type InsightsTrendingRetrieveOutput = Awaited<ReturnType<typeof posthog.insightsTrendingRetrieve>>;
1681
+
1682
+ const result: InsightsTrendingRetrieveOutput = await posthog.insightsTrendingRetrieve();
1683
+
1684
+ // Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: number; short_id: string; name?: string | null; derived_name?: string | null; query?: unknown; dashboards: (number)[]; dashboard_tiles: ({...
1685
+ ```
1686
+
1687
+ ### `posthog.insightsViewedCreate`
1688
+
1689
+ - **HTTP**: `POST /api/projects/{project_id}/insights/viewed/`
1690
+ - **What it does**: Record that the current user has just viewed one or more insights. Submitted ids that do not belong to the current project or that point at deleted insights are silently dropped. Returns 201 on success regardless of how many ids were retained.
1691
+ - **OpenAPI operationId**: `insights_viewed_create`
1692
+ - **Path params**: None
1693
+ - **Query params**: `format`
1694
+ - **Response codes**: `201`
1695
+ - **Transport options**: None
1696
+ - **TypeScript**: [Client interface](../types.ts)
1697
+
1698
+ **Inputs**
1699
+
1700
+ - Client input type: `{ [key: string]: unknown }`
1701
+ - Client transport options: None
1702
+
1703
+ **Outputs**
1704
+
1705
+ - Client return type: `unknown`
1706
+ - OpenAPI response codes: `201`
1707
+
1708
+ ```ts
1709
+ import posthog from "@utdk/posthog";
1710
+
1711
+ type InsightsViewedCreateInput = Parameters<typeof posthog.insightsViewedCreate> extends [infer T, ...unknown[]] ? T : undefined;
1712
+ type InsightsViewedCreateOutput = Awaited<ReturnType<typeof posthog.insightsViewedCreate>>;
1713
+
1714
+ const result: InsightsViewedCreateOutput = await posthog.insightsViewedCreate();
1715
+
1716
+ // Result shape (from schema): unknown
1717
+ ```
1718
+
1719
+
1720
+ <!-- prompt-hash:
1721
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
1722
+ -->