@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,462 @@
1
+ # Metrics
2
+
3
+ ## Operations
4
+
5
+ ### `posthog.environmentsMetricsAttributeValuesRetrieve`
6
+
7
+ - **HTTP**: `GET /api/environments/{environment_id}/metrics/attribute_values/`
8
+ - **What it does**: Observed values for one metric attribute key, most frequent first.
9
+ Backs the filter bar's value autocomplete.
10
+ - **OpenAPI operationId**: `environments_metrics_attribute_values_retrieve`
11
+ - **Path params**: None
12
+ - **Query params**: `dateFrom`, `dateTo`, `key`, `limit`, `value`
13
+ - **Response codes**: `200`
14
+ - **Transport options**: None
15
+ - **TypeScript**: [Client interface](../types.ts)
16
+
17
+ **Inputs**
18
+
19
+ - Client input type: `{ [key: string]: unknown }`
20
+ - Client transport options: None
21
+
22
+ **Outputs**
23
+
24
+ - Client return type: `{ results: ({ id: string; name: string; count: number })[] }`
25
+ - OpenAPI response codes: `200`
26
+
27
+ ```ts
28
+ import posthog from "@utdk/posthog";
29
+
30
+ type EnvironmentsMetricsAttributeValuesRetrieveInput = Parameters<typeof posthog.environmentsMetricsAttributeValuesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
31
+ type EnvironmentsMetricsAttributeValuesRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsAttributeValuesRetrieve>>;
32
+
33
+ const result: EnvironmentsMetricsAttributeValuesRetrieveOutput = await posthog.environmentsMetricsAttributeValuesRetrieve();
34
+
35
+ // Result shape (from schema): { results: ({ id: string; name: string; count: number })[] }
36
+ ```
37
+
38
+ ### `posthog.environmentsMetricsAttributesRetrieve`
39
+
40
+ - **HTTP**: `GET /api/environments/{environment_id}/metrics/attributes/`
41
+ - **What it does**: Distinct attribute keys seen on the team's metrics (datapoint and
42
+ resource attributes merged), most frequent first. Backs the filter
43
+ bar's key autocomplete.
44
+ - **OpenAPI operationId**: `environments_metrics_attributes_retrieve`
45
+ - **Path params**: None
46
+ - **Query params**: `dateFrom`, `dateTo`, `limit`, `search`
47
+ - **Response codes**: `200`
48
+ - **Transport options**: None
49
+ - **TypeScript**: [Client interface](../types.ts)
50
+
51
+ **Inputs**
52
+
53
+ - Client input type: `{ [key: string]: unknown }`
54
+ - Client transport options: None
55
+
56
+ **Outputs**
57
+
58
+ - Client return type: `{ results: ({ name: string })[]; count: number }`
59
+ - OpenAPI response codes: `200`
60
+
61
+ ```ts
62
+ import posthog from "@utdk/posthog";
63
+
64
+ type EnvironmentsMetricsAttributesRetrieveInput = Parameters<typeof posthog.environmentsMetricsAttributesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
65
+ type EnvironmentsMetricsAttributesRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsAttributesRetrieve>>;
66
+
67
+ const result: EnvironmentsMetricsAttributesRetrieveOutput = await posthog.environmentsMetricsAttributesRetrieve();
68
+
69
+ // Result shape (from schema): { results: ({ name: string })[]; count: number }
70
+ ```
71
+
72
+ ### `posthog.environmentsMetricsCharacterizeCreate`
73
+
74
+ - **HTTP**: `POST /api/environments/{environment_id}/metrics/characterize/`
75
+ - **What it does**: Characterize a metric anomaly: compare an anomaly window against a
76
+ baseline, find the onset, and rank which label values moved.
77
+ - **OpenAPI operationId**: `environments_metrics_characterize_create`
78
+ - **Path params**: None
79
+ - **Query params**: None
80
+ - **Response codes**: `200`
81
+ - **Transport options**: None
82
+ - **TypeScript**: [Client interface](../types.ts)
83
+
84
+ **Inputs**
85
+
86
+ - Client input type: `{ [key: string]: unknown }`
87
+ - Client transport options: None
88
+
89
+ **Outputs**
90
+
91
+ - Client return type: `{ metric_name: string; aggregation: string; interval: string; baseline_from: string; baseline_to: string; anomaly_from: string; anomaly_to: string; baseline_mean: number; baseline_stddev: number; anomaly_mean: number; a...`
92
+ - OpenAPI response codes: `200`
93
+
94
+ ```ts
95
+ import posthog from "@utdk/posthog";
96
+
97
+ type EnvironmentsMetricsCharacterizeCreateInput = Parameters<typeof posthog.environmentsMetricsCharacterizeCreate> extends [infer T, ...unknown[]] ? T : undefined;
98
+ type EnvironmentsMetricsCharacterizeCreateOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsCharacterizeCreate>>;
99
+
100
+ const result: EnvironmentsMetricsCharacterizeCreateOutput = await posthog.environmentsMetricsCharacterizeCreate();
101
+
102
+ // Result shape (from schema): { metric_name: string; aggregation: string; interval: string; baseline_from: string; baseline_to: string; anomaly_from: string; anomaly_to: string; baseline_mean: number; baseline_stddev: number; anomaly_mean: number; a...
103
+ ```
104
+
105
+ ### `posthog.environmentsMetricsHasMetricsRetrieve`
106
+
107
+ - **HTTP**: `GET /api/environments/{environment_id}/metrics/has_metrics/`
108
+ - **OpenAPI operationId**: `environments_metrics_has_metrics_retrieve`
109
+ - **Path params**: None
110
+ - **Query params**: None
111
+ - **Response codes**: `200`
112
+ - **Transport options**: None
113
+ - **TypeScript**: [Client interface](../types.ts)
114
+
115
+ **Inputs**
116
+
117
+ - Client input type: `{ [key: string]: unknown }`
118
+ - Client transport options: None
119
+
120
+ **Outputs**
121
+
122
+ - Client return type: `{ hasMetrics: boolean }`
123
+ - OpenAPI response codes: `200`
124
+
125
+ ```ts
126
+ import posthog from "@utdk/posthog";
127
+
128
+ type EnvironmentsMetricsHasMetricsRetrieveInput = Parameters<typeof posthog.environmentsMetricsHasMetricsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
129
+ type EnvironmentsMetricsHasMetricsRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsHasMetricsRetrieve>>;
130
+
131
+ const result: EnvironmentsMetricsHasMetricsRetrieveOutput = await posthog.environmentsMetricsHasMetricsRetrieve();
132
+
133
+ // Result shape (from schema): { hasMetrics: boolean }
134
+ ```
135
+
136
+ ### `posthog.environmentsMetricsQueryCreate`
137
+
138
+ - **HTTP**: `POST /api/environments/{environment_id}/metrics/query/`
139
+ - **OpenAPI operationId**: `environments_metrics_query_create`
140
+ - **Path params**: None
141
+ - **Query params**: None
142
+ - **Response codes**: `200`
143
+ - **Transport options**: None
144
+ - **TypeScript**: [Client interface](../types.ts)
145
+
146
+ **Inputs**
147
+
148
+ - Client input type: `{ [key: string]: unknown }`
149
+ - Client transport options: None
150
+
151
+ **Outputs**
152
+
153
+ - Client return type: `{ results: ({ labels: { [key: string]: string | undefined }; points: ({ time: string; value: number | null })[]; metric_name?: string | null; clause?: string | null })[] }`
154
+ - OpenAPI response codes: `200`
155
+
156
+ ```ts
157
+ import posthog from "@utdk/posthog";
158
+
159
+ type EnvironmentsMetricsQueryCreateInput = Parameters<typeof posthog.environmentsMetricsQueryCreate> extends [infer T, ...unknown[]] ? T : undefined;
160
+ type EnvironmentsMetricsQueryCreateOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsQueryCreate>>;
161
+
162
+ const result: EnvironmentsMetricsQueryCreateOutput = await posthog.environmentsMetricsQueryCreate();
163
+
164
+ // Result shape (from schema): { results: ({ labels: { [key: string]: string | undefined }; points: ({ time: string; value: number | null })[]; metric_name?: string | null; clause?: string | null })[] }
165
+ ```
166
+
167
+ ### `posthog.environmentsMetricsSamplesCreate`
168
+
169
+ - **HTTP**: `POST /api/environments/{environment_id}/metrics/samples/`
170
+ - **What it does**: Raw individual emissions for a metric (the events model), newest
171
+ first — backs the Samples view and the metric->trace pivot.
172
+ - **OpenAPI operationId**: `environments_metrics_samples_create`
173
+ - **Path params**: None
174
+ - **Query params**: None
175
+ - **Response codes**: `200`
176
+ - **Transport options**: None
177
+ - **TypeScript**: [Client interface](../types.ts)
178
+
179
+ **Inputs**
180
+
181
+ - Client input type: `{ [key: string]: unknown }`
182
+ - Client transport options: None
183
+
184
+ **Outputs**
185
+
186
+ - Client return type: `{ results: ({ timestamp: string; metric_name: string; metric_type: string; value: number; count: number; unit: string; aggregation_temporality: string; is_monotonic: boolean; service_name: string; trace_id: string; span...`
187
+ - OpenAPI response codes: `200`
188
+
189
+ ```ts
190
+ import posthog from "@utdk/posthog";
191
+
192
+ type EnvironmentsMetricsSamplesCreateInput = Parameters<typeof posthog.environmentsMetricsSamplesCreate> extends [infer T, ...unknown[]] ? T : undefined;
193
+ type EnvironmentsMetricsSamplesCreateOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsSamplesCreate>>;
194
+
195
+ const result: EnvironmentsMetricsSamplesCreateOutput = await posthog.environmentsMetricsSamplesCreate();
196
+
197
+ // Result shape (from schema): { results: ({ timestamp: string; metric_name: string; metric_type: string; value: number; count: number; unit: string; aggregation_temporality: string; is_monotonic: boolean; service_name: string; trace_id: string; span...
198
+ ```
199
+
200
+ ### `posthog.environmentsMetricsValuesRetrieve`
201
+
202
+ - **HTTP**: `GET /api/environments/{environment_id}/metrics/values/`
203
+ - **What it does**: Distinct metric names for the team. Backs the picker UI.
204
+ - **OpenAPI operationId**: `environments_metrics_values_retrieve`
205
+ - **Path params**: None
206
+ - **Query params**: `limit`, `value`
207
+ - **Response codes**: `200`
208
+ - **Transport options**: None
209
+ - **TypeScript**: [Client interface](../types.ts)
210
+
211
+ **Inputs**
212
+
213
+ - Client input type: `{ [key: string]: unknown }`
214
+ - Client transport options: None
215
+
216
+ **Outputs**
217
+
218
+ - Client return type: `{ results: ({ name: string; metric_type: string })[] }`
219
+ - OpenAPI response codes: `200`
220
+
221
+ ```ts
222
+ import posthog from "@utdk/posthog";
223
+
224
+ type EnvironmentsMetricsValuesRetrieveInput = Parameters<typeof posthog.environmentsMetricsValuesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
225
+ type EnvironmentsMetricsValuesRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsMetricsValuesRetrieve>>;
226
+
227
+ const result: EnvironmentsMetricsValuesRetrieveOutput = await posthog.environmentsMetricsValuesRetrieve();
228
+
229
+ // Result shape (from schema): { results: ({ name: string; metric_type: string })[] }
230
+ ```
231
+
232
+ ### `posthog.metricsAttributeValuesRetrieve`
233
+
234
+ - **HTTP**: `GET /api/projects/{project_id}/metrics/attribute_values/`
235
+ - **What it does**: Observed values for one metric attribute key, most frequent first.
236
+ Backs the filter bar's value autocomplete.
237
+ - **OpenAPI operationId**: `metrics_attribute_values_retrieve`
238
+ - **Path params**: None
239
+ - **Query params**: `dateFrom`, `dateTo`, `key`, `limit`, `value`
240
+ - **Response codes**: `200`
241
+ - **Transport options**: None
242
+ - **TypeScript**: [Client interface](../types.ts)
243
+
244
+ **Inputs**
245
+
246
+ - Client input type: `{ [key: string]: unknown }`
247
+ - Client transport options: None
248
+
249
+ **Outputs**
250
+
251
+ - Client return type: `{ results: ({ id: string; name: string; count: number })[] }`
252
+ - OpenAPI response codes: `200`
253
+
254
+ ```ts
255
+ import posthog from "@utdk/posthog";
256
+
257
+ type MetricsAttributeValuesRetrieveInput = Parameters<typeof posthog.metricsAttributeValuesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
258
+ type MetricsAttributeValuesRetrieveOutput = Awaited<ReturnType<typeof posthog.metricsAttributeValuesRetrieve>>;
259
+
260
+ const result: MetricsAttributeValuesRetrieveOutput = await posthog.metricsAttributeValuesRetrieve();
261
+
262
+ // Result shape (from schema): { results: ({ id: string; name: string; count: number })[] }
263
+ ```
264
+
265
+ ### `posthog.metricsAttributesRetrieve`
266
+
267
+ - **HTTP**: `GET /api/projects/{project_id}/metrics/attributes/`
268
+ - **What it does**: Distinct attribute keys seen on the team's metrics (datapoint and
269
+ resource attributes merged), most frequent first. Backs the filter
270
+ bar's key autocomplete.
271
+ - **OpenAPI operationId**: `metrics_attributes_retrieve`
272
+ - **Path params**: None
273
+ - **Query params**: `dateFrom`, `dateTo`, `limit`, `search`
274
+ - **Response codes**: `200`
275
+ - **Transport options**: None
276
+ - **TypeScript**: [Client interface](../types.ts)
277
+
278
+ **Inputs**
279
+
280
+ - Client input type: `{ [key: string]: unknown }`
281
+ - Client transport options: None
282
+
283
+ **Outputs**
284
+
285
+ - Client return type: `{ results: ({ name: string })[]; count: number }`
286
+ - OpenAPI response codes: `200`
287
+
288
+ ```ts
289
+ import posthog from "@utdk/posthog";
290
+
291
+ type MetricsAttributesRetrieveInput = Parameters<typeof posthog.metricsAttributesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
292
+ type MetricsAttributesRetrieveOutput = Awaited<ReturnType<typeof posthog.metricsAttributesRetrieve>>;
293
+
294
+ const result: MetricsAttributesRetrieveOutput = await posthog.metricsAttributesRetrieve();
295
+
296
+ // Result shape (from schema): { results: ({ name: string })[]; count: number }
297
+ ```
298
+
299
+ ### `posthog.metricsCharacterizeCreate`
300
+
301
+ - **HTTP**: `POST /api/projects/{project_id}/metrics/characterize/`
302
+ - **What it does**: Characterize a metric anomaly: compare an anomaly window against a
303
+ baseline, find the onset, and rank which label values moved.
304
+ - **OpenAPI operationId**: `metrics_characterize_create`
305
+ - **Path params**: None
306
+ - **Query params**: None
307
+ - **Response codes**: `200`
308
+ - **Transport options**: None
309
+ - **TypeScript**: [Client interface](../types.ts)
310
+
311
+ **Inputs**
312
+
313
+ - Client input type: `{ [key: string]: unknown }`
314
+ - Client transport options: None
315
+
316
+ **Outputs**
317
+
318
+ - Client return type: `{ metric_name: string; aggregation: string; interval: string; baseline_from: string; baseline_to: string; anomaly_from: string; anomaly_to: string; baseline_mean: number; baseline_stddev: number; anomaly_mean: number; a...`
319
+ - OpenAPI response codes: `200`
320
+
321
+ ```ts
322
+ import posthog from "@utdk/posthog";
323
+
324
+ type MetricsCharacterizeCreateInput = Parameters<typeof posthog.metricsCharacterizeCreate> extends [infer T, ...unknown[]] ? T : undefined;
325
+ type MetricsCharacterizeCreateOutput = Awaited<ReturnType<typeof posthog.metricsCharacterizeCreate>>;
326
+
327
+ const result: MetricsCharacterizeCreateOutput = await posthog.metricsCharacterizeCreate();
328
+
329
+ // Result shape (from schema): { metric_name: string; aggregation: string; interval: string; baseline_from: string; baseline_to: string; anomaly_from: string; anomaly_to: string; baseline_mean: number; baseline_stddev: number; anomaly_mean: number; a...
330
+ ```
331
+
332
+ ### `posthog.metricsHasMetricsRetrieve`
333
+
334
+ - **HTTP**: `GET /api/projects/{project_id}/metrics/has_metrics/`
335
+ - **OpenAPI operationId**: `metrics_has_metrics_retrieve`
336
+ - **Path params**: None
337
+ - **Query params**: None
338
+ - **Response codes**: `200`
339
+ - **Transport options**: None
340
+ - **TypeScript**: [Client interface](../types.ts)
341
+
342
+ **Inputs**
343
+
344
+ - Client input type: `{ [key: string]: unknown }`
345
+ - Client transport options: None
346
+
347
+ **Outputs**
348
+
349
+ - Client return type: `{ hasMetrics: boolean }`
350
+ - OpenAPI response codes: `200`
351
+
352
+ ```ts
353
+ import posthog from "@utdk/posthog";
354
+
355
+ type MetricsHasMetricsRetrieveInput = Parameters<typeof posthog.metricsHasMetricsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
356
+ type MetricsHasMetricsRetrieveOutput = Awaited<ReturnType<typeof posthog.metricsHasMetricsRetrieve>>;
357
+
358
+ const result: MetricsHasMetricsRetrieveOutput = await posthog.metricsHasMetricsRetrieve();
359
+
360
+ // Result shape (from schema): { hasMetrics: boolean }
361
+ ```
362
+
363
+ ### `posthog.metricsQueryCreate`
364
+
365
+ - **HTTP**: `POST /api/projects/{project_id}/metrics/query/`
366
+ - **OpenAPI operationId**: `metrics_query_create`
367
+ - **Path params**: None
368
+ - **Query params**: None
369
+ - **Response codes**: `200`
370
+ - **Transport options**: None
371
+ - **TypeScript**: [Client interface](../types.ts)
372
+
373
+ **Inputs**
374
+
375
+ - Client input type: `{ [key: string]: unknown }`
376
+ - Client transport options: None
377
+
378
+ **Outputs**
379
+
380
+ - Client return type: `{ results: ({ labels: { [key: string]: string | undefined }; points: ({ time: string; value: number | null })[]; metric_name?: string | null; clause?: string | null })[] }`
381
+ - OpenAPI response codes: `200`
382
+
383
+ ```ts
384
+ import posthog from "@utdk/posthog";
385
+
386
+ type MetricsQueryCreateInput = Parameters<typeof posthog.metricsQueryCreate> extends [infer T, ...unknown[]] ? T : undefined;
387
+ type MetricsQueryCreateOutput = Awaited<ReturnType<typeof posthog.metricsQueryCreate>>;
388
+
389
+ const result: MetricsQueryCreateOutput = await posthog.metricsQueryCreate();
390
+
391
+ // Result shape (from schema): { results: ({ labels: { [key: string]: string | undefined }; points: ({ time: string; value: number | null })[]; metric_name?: string | null; clause?: string | null })[] }
392
+ ```
393
+
394
+ ### `posthog.metricsSamplesCreate`
395
+
396
+ - **HTTP**: `POST /api/projects/{project_id}/metrics/samples/`
397
+ - **What it does**: Raw individual emissions for a metric (the events model), newest
398
+ first — backs the Samples view and the metric->trace pivot.
399
+ - **OpenAPI operationId**: `metrics_samples_create`
400
+ - **Path params**: None
401
+ - **Query params**: None
402
+ - **Response codes**: `200`
403
+ - **Transport options**: None
404
+ - **TypeScript**: [Client interface](../types.ts)
405
+
406
+ **Inputs**
407
+
408
+ - Client input type: `{ [key: string]: unknown }`
409
+ - Client transport options: None
410
+
411
+ **Outputs**
412
+
413
+ - Client return type: `{ results: ({ timestamp: string; metric_name: string; metric_type: string; value: number; count: number; unit: string; aggregation_temporality: string; is_monotonic: boolean; service_name: string; trace_id: string; span...`
414
+ - OpenAPI response codes: `200`
415
+
416
+ ```ts
417
+ import posthog from "@utdk/posthog";
418
+
419
+ type MetricsSamplesCreateInput = Parameters<typeof posthog.metricsSamplesCreate> extends [infer T, ...unknown[]] ? T : undefined;
420
+ type MetricsSamplesCreateOutput = Awaited<ReturnType<typeof posthog.metricsSamplesCreate>>;
421
+
422
+ const result: MetricsSamplesCreateOutput = await posthog.metricsSamplesCreate();
423
+
424
+ // Result shape (from schema): { results: ({ timestamp: string; metric_name: string; metric_type: string; value: number; count: number; unit: string; aggregation_temporality: string; is_monotonic: boolean; service_name: string; trace_id: string; span...
425
+ ```
426
+
427
+ ### `posthog.metricsValuesRetrieve`
428
+
429
+ - **HTTP**: `GET /api/projects/{project_id}/metrics/values/`
430
+ - **What it does**: Distinct metric names for the team. Backs the picker UI.
431
+ - **OpenAPI operationId**: `metrics_values_retrieve`
432
+ - **Path params**: None
433
+ - **Query params**: `limit`, `value`
434
+ - **Response codes**: `200`
435
+ - **Transport options**: None
436
+ - **TypeScript**: [Client interface](../types.ts)
437
+
438
+ **Inputs**
439
+
440
+ - Client input type: `{ [key: string]: unknown }`
441
+ - Client transport options: None
442
+
443
+ **Outputs**
444
+
445
+ - Client return type: `{ results: ({ name: string; metric_type: string })[] }`
446
+ - OpenAPI response codes: `200`
447
+
448
+ ```ts
449
+ import posthog from "@utdk/posthog";
450
+
451
+ type MetricsValuesRetrieveInput = Parameters<typeof posthog.metricsValuesRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
452
+ type MetricsValuesRetrieveOutput = Awaited<ReturnType<typeof posthog.metricsValuesRetrieve>>;
453
+
454
+ const result: MetricsValuesRetrieveOutput = await posthog.metricsValuesRetrieve();
455
+
456
+ // Result shape (from schema): { results: ({ name: string; metric_type: string })[] }
457
+ ```
458
+
459
+
460
+ <!-- prompt-hash:
461
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
462
+ -->