@crvouga/mockingbird-service-posthog 1.8.0 → 2.1.0
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.
- package/CHANGELOG.md +35 -1
- package/DISCOVERY.md +55 -0
- package/README.md +3 -3
- package/SUPPORT.md +26 -0
- package/dist/{chunk-LKPLI7YI.js → chunk-SCY2VOTE.js} +43 -23
- package/dist/chunk-SCY2VOTE.js.map +7 -0
- package/dist/chunk-VZ3ZHVNW.js +3821 -0
- package/dist/chunk-VZ3ZHVNW.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -2
- package/openapi.yaml +1017 -0
- package/package.json +29 -4
- package/dist/chunk-LKPLI7YI.js.map +0 -7
- package/dist/chunk-Y3KAEWE2.js +0 -5628
- package/dist/chunk-Y3KAEWE2.js.map +0 -7
package/openapi.yaml
ADDED
|
@@ -0,0 +1,1017 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
title: PostHog feature flags, capture and management API (Mockingbird subset)
|
|
4
|
+
description: |
|
|
5
|
+
Stateful mock subset of PostHog: remote flag evaluation (`/flags` v2 and the legacy
|
|
6
|
+
`/decide` shape), remote config, event capture (`/batch/`, `/e/`, `/i/v0/e/`), session
|
|
7
|
+
recording intake, the posthog-js asset and survey endpoints, and the slice of the
|
|
8
|
+
management API our tooling and crons call (feature-flag list/create/patch, HogQL query).
|
|
9
|
+
Hand-authored from the wire shapes of posthog-node 5.52.2 / @posthog/core 1.54.0,
|
|
10
|
+
posthog-js 1.433.2 and our own raw fetches.
|
|
11
|
+
|
|
12
|
+
Paths are written without the trailing slash PostHog uses; the mock answers both
|
|
13
|
+
(`/flags/?v=2` from the SDKs and `/flags?v=2` from the EMR frontend's raw fetch).
|
|
14
|
+
Capture and flag bodies may arrive gzip-compressed (`Content-Encoding: gzip`, or raw gzip
|
|
15
|
+
bytes from posthog-js), base64 (`data=` form bodies), or as plain JSON; the contract
|
|
16
|
+
declares the decoded JSON.
|
|
17
|
+
version: "1"
|
|
18
|
+
x-mockingbird-upstream:
|
|
19
|
+
note: >-
|
|
20
|
+
Hand-authored from @posthog/core posthog-core-stateless (getFlags, sendBatch,
|
|
21
|
+
getRemoteConfig, getSurveysStateless), posthog-js request.ts / posthog-featureflags.ts,
|
|
22
|
+
and the consumer's posthog-server.adapter.ts, posthog-server.ts (EMR frontend),
|
|
23
|
+
website-posthog-purchase.sink.ts, posthog-hogql.client.ts and feature-flags-cli.
|
|
24
|
+
servers:
|
|
25
|
+
- url: https://us.i.posthog.com
|
|
26
|
+
paths:
|
|
27
|
+
/flags:
|
|
28
|
+
post:
|
|
29
|
+
operationId: EvaluateFlags
|
|
30
|
+
description: |
|
|
31
|
+
Remote flag evaluation. `v=2` (what every current SDK sends) answers the `flags` detail
|
|
32
|
+
map; no `v` or `v=1` answers the legacy `featureFlags`/`featureFlagPayloads` maps.
|
|
33
|
+
`config=true` adds the remote-config fields. The project key is `token` (SDKs) or
|
|
34
|
+
`api_key` (the EMR frontend's raw fetch).
|
|
35
|
+
security: []
|
|
36
|
+
x-mockingbird:
|
|
37
|
+
supported: true
|
|
38
|
+
parity:
|
|
39
|
+
enabled: true
|
|
40
|
+
safe: true
|
|
41
|
+
parameters:
|
|
42
|
+
- $ref: "#/components/parameters/Version"
|
|
43
|
+
- $ref: "#/components/parameters/Config"
|
|
44
|
+
requestBody:
|
|
45
|
+
required: true
|
|
46
|
+
content:
|
|
47
|
+
application/json:
|
|
48
|
+
schema:
|
|
49
|
+
$ref: "#/components/schemas/FlagsRequest"
|
|
50
|
+
responses:
|
|
51
|
+
"200":
|
|
52
|
+
description: Evaluated flags
|
|
53
|
+
content:
|
|
54
|
+
application/json:
|
|
55
|
+
schema:
|
|
56
|
+
$ref: "#/components/schemas/FlagsResponse"
|
|
57
|
+
"400":
|
|
58
|
+
description: Malformed body or missing distinct_id
|
|
59
|
+
content:
|
|
60
|
+
application/json:
|
|
61
|
+
schema:
|
|
62
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
63
|
+
"401":
|
|
64
|
+
description: No project API key
|
|
65
|
+
content:
|
|
66
|
+
application/json:
|
|
67
|
+
schema:
|
|
68
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
69
|
+
"429":
|
|
70
|
+
description: Rate limited (fault preset flags_429)
|
|
71
|
+
content:
|
|
72
|
+
application/json:
|
|
73
|
+
schema:
|
|
74
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
75
|
+
"500":
|
|
76
|
+
description: Server error (fault preset flags_5xx)
|
|
77
|
+
content:
|
|
78
|
+
application/json:
|
|
79
|
+
schema:
|
|
80
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
81
|
+
/decide:
|
|
82
|
+
post:
|
|
83
|
+
operationId: Decide
|
|
84
|
+
description: |
|
|
85
|
+
The legacy endpoint (the Python client sends `POST /decide/?v=3` with
|
|
86
|
+
`{api_key, distinct_id}`). `v` < 4 answers the legacy maps; `v=4` the `flags` map.
|
|
87
|
+
security: []
|
|
88
|
+
x-mockingbird:
|
|
89
|
+
supported: true
|
|
90
|
+
parity:
|
|
91
|
+
enabled: true
|
|
92
|
+
safe: true
|
|
93
|
+
parameters:
|
|
94
|
+
- $ref: "#/components/parameters/Version"
|
|
95
|
+
requestBody:
|
|
96
|
+
required: true
|
|
97
|
+
content:
|
|
98
|
+
application/json:
|
|
99
|
+
schema:
|
|
100
|
+
$ref: "#/components/schemas/FlagsRequest"
|
|
101
|
+
responses:
|
|
102
|
+
"200":
|
|
103
|
+
description: Evaluated flags (legacy shape)
|
|
104
|
+
content:
|
|
105
|
+
application/json:
|
|
106
|
+
schema:
|
|
107
|
+
$ref: "#/components/schemas/FlagsResponse"
|
|
108
|
+
"400":
|
|
109
|
+
description: Malformed body or missing distinct_id
|
|
110
|
+
content:
|
|
111
|
+
application/json:
|
|
112
|
+
schema:
|
|
113
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
114
|
+
"401":
|
|
115
|
+
description: No project API key
|
|
116
|
+
content:
|
|
117
|
+
application/json:
|
|
118
|
+
schema:
|
|
119
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
120
|
+
"429":
|
|
121
|
+
description: Rate limited (fault preset flags_429)
|
|
122
|
+
content:
|
|
123
|
+
application/json:
|
|
124
|
+
schema:
|
|
125
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
126
|
+
"500":
|
|
127
|
+
description: Server error (fault preset flags_5xx)
|
|
128
|
+
content:
|
|
129
|
+
application/json:
|
|
130
|
+
schema:
|
|
131
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
132
|
+
/array/{token}/config:
|
|
133
|
+
parameters:
|
|
134
|
+
- $ref: "#/components/parameters/TokenPath"
|
|
135
|
+
get:
|
|
136
|
+
operationId: GetRemoteConfig
|
|
137
|
+
security: []
|
|
138
|
+
x-mockingbird:
|
|
139
|
+
supported: true
|
|
140
|
+
parity:
|
|
141
|
+
enabled: true
|
|
142
|
+
safe: true
|
|
143
|
+
responses:
|
|
144
|
+
"200":
|
|
145
|
+
description: Remote config (posthog-react-native, @posthog/core)
|
|
146
|
+
content:
|
|
147
|
+
application/json:
|
|
148
|
+
schema:
|
|
149
|
+
$ref: "#/components/schemas/RemoteConfig"
|
|
150
|
+
/array/{token}/config.js:
|
|
151
|
+
parameters:
|
|
152
|
+
- $ref: "#/components/parameters/TokenPath"
|
|
153
|
+
get:
|
|
154
|
+
operationId: GetRemoteConfigScript
|
|
155
|
+
security: []
|
|
156
|
+
x-mockingbird:
|
|
157
|
+
supported: true
|
|
158
|
+
parity:
|
|
159
|
+
enabled: true
|
|
160
|
+
safe: true
|
|
161
|
+
responses:
|
|
162
|
+
"200":
|
|
163
|
+
description: >-
|
|
164
|
+
Remote config as a script that sets `window._POSTHOG_REMOTE_CONFIG[token]`
|
|
165
|
+
(posthog-js)
|
|
166
|
+
content:
|
|
167
|
+
application/javascript:
|
|
168
|
+
schema:
|
|
169
|
+
type: string
|
|
170
|
+
/batch:
|
|
171
|
+
post:
|
|
172
|
+
operationId: CaptureBatch
|
|
173
|
+
description: "posthog-node and posthog-react-native flushes (Content-Encoding: gzip)."
|
|
174
|
+
security: []
|
|
175
|
+
x-mockingbird:
|
|
176
|
+
supported: true
|
|
177
|
+
parity:
|
|
178
|
+
enabled: true
|
|
179
|
+
safe: false
|
|
180
|
+
requestBody:
|
|
181
|
+
required: true
|
|
182
|
+
content:
|
|
183
|
+
application/json:
|
|
184
|
+
schema:
|
|
185
|
+
$ref: "#/components/schemas/BatchRequest"
|
|
186
|
+
responses:
|
|
187
|
+
"200":
|
|
188
|
+
description: Accepted
|
|
189
|
+
content:
|
|
190
|
+
application/json:
|
|
191
|
+
schema:
|
|
192
|
+
$ref: "#/components/schemas/CaptureResponse"
|
|
193
|
+
"400":
|
|
194
|
+
description: Malformed body
|
|
195
|
+
content:
|
|
196
|
+
application/json:
|
|
197
|
+
schema:
|
|
198
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
199
|
+
"401":
|
|
200
|
+
description: No project API key
|
|
201
|
+
content:
|
|
202
|
+
application/json:
|
|
203
|
+
schema:
|
|
204
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
205
|
+
"500":
|
|
206
|
+
description: Server error (fault)
|
|
207
|
+
content:
|
|
208
|
+
application/json:
|
|
209
|
+
schema:
|
|
210
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
211
|
+
/e:
|
|
212
|
+
post:
|
|
213
|
+
operationId: CaptureEvent
|
|
214
|
+
description: One event, an array of events, or `{api_key, batch}` (posthog-js).
|
|
215
|
+
security: []
|
|
216
|
+
x-mockingbird:
|
|
217
|
+
supported: true
|
|
218
|
+
parity:
|
|
219
|
+
enabled: true
|
|
220
|
+
safe: false
|
|
221
|
+
requestBody:
|
|
222
|
+
required: true
|
|
223
|
+
content:
|
|
224
|
+
application/json:
|
|
225
|
+
schema:
|
|
226
|
+
$ref: "#/components/schemas/CaptureRequest"
|
|
227
|
+
responses:
|
|
228
|
+
"200":
|
|
229
|
+
description: Accepted
|
|
230
|
+
content:
|
|
231
|
+
application/json:
|
|
232
|
+
schema:
|
|
233
|
+
$ref: "#/components/schemas/CaptureResponse"
|
|
234
|
+
"400":
|
|
235
|
+
description: Malformed body
|
|
236
|
+
content:
|
|
237
|
+
application/json:
|
|
238
|
+
schema:
|
|
239
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
240
|
+
"401":
|
|
241
|
+
description: No project API key
|
|
242
|
+
content:
|
|
243
|
+
application/json:
|
|
244
|
+
schema:
|
|
245
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
246
|
+
"500":
|
|
247
|
+
description: Server error (fault)
|
|
248
|
+
content:
|
|
249
|
+
application/json:
|
|
250
|
+
schema:
|
|
251
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
252
|
+
/i/v0/e:
|
|
253
|
+
post:
|
|
254
|
+
operationId: CaptureEventV0
|
|
255
|
+
description: >-
|
|
256
|
+
The capture endpoint remote config advertises (`analytics.endpoint`); also our backend's
|
|
257
|
+
website purchase sink (`{api_key, event, distinct_id, timestamp, uuid, properties}`).
|
|
258
|
+
security: []
|
|
259
|
+
x-mockingbird:
|
|
260
|
+
supported: true
|
|
261
|
+
parity:
|
|
262
|
+
enabled: true
|
|
263
|
+
safe: false
|
|
264
|
+
requestBody:
|
|
265
|
+
required: true
|
|
266
|
+
content:
|
|
267
|
+
application/json:
|
|
268
|
+
schema:
|
|
269
|
+
$ref: "#/components/schemas/CaptureRequest"
|
|
270
|
+
responses:
|
|
271
|
+
"200":
|
|
272
|
+
description: Accepted
|
|
273
|
+
content:
|
|
274
|
+
application/json:
|
|
275
|
+
schema:
|
|
276
|
+
$ref: "#/components/schemas/CaptureResponse"
|
|
277
|
+
"400":
|
|
278
|
+
description: Malformed body
|
|
279
|
+
content:
|
|
280
|
+
application/json:
|
|
281
|
+
schema:
|
|
282
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
283
|
+
"401":
|
|
284
|
+
description: No project API key
|
|
285
|
+
content:
|
|
286
|
+
application/json:
|
|
287
|
+
schema:
|
|
288
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
289
|
+
"500":
|
|
290
|
+
description: Server error (fault)
|
|
291
|
+
content:
|
|
292
|
+
application/json:
|
|
293
|
+
schema:
|
|
294
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
295
|
+
/s:
|
|
296
|
+
post:
|
|
297
|
+
operationId: CaptureRecording
|
|
298
|
+
description: Session-recording snapshots; counted, never stored.
|
|
299
|
+
security: []
|
|
300
|
+
x-mockingbird:
|
|
301
|
+
supported: true
|
|
302
|
+
parity:
|
|
303
|
+
enabled: true
|
|
304
|
+
safe: false
|
|
305
|
+
requestBody:
|
|
306
|
+
required: true
|
|
307
|
+
content:
|
|
308
|
+
application/json:
|
|
309
|
+
schema:
|
|
310
|
+
$ref: "#/components/schemas/CaptureRequest"
|
|
311
|
+
responses:
|
|
312
|
+
"200":
|
|
313
|
+
description: Accepted
|
|
314
|
+
content:
|
|
315
|
+
application/json:
|
|
316
|
+
schema:
|
|
317
|
+
$ref: "#/components/schemas/CaptureResponse"
|
|
318
|
+
/static/recorder.js:
|
|
319
|
+
get:
|
|
320
|
+
operationId: GetRecorderScript
|
|
321
|
+
security: []
|
|
322
|
+
x-mockingbird:
|
|
323
|
+
supported: true
|
|
324
|
+
parity:
|
|
325
|
+
enabled: true
|
|
326
|
+
safe: true
|
|
327
|
+
responses:
|
|
328
|
+
"200":
|
|
329
|
+
description: The session recorder bundle (an inert script here)
|
|
330
|
+
content:
|
|
331
|
+
application/javascript:
|
|
332
|
+
schema:
|
|
333
|
+
type: string
|
|
334
|
+
/static/{version}/recorder.js:
|
|
335
|
+
parameters:
|
|
336
|
+
- name: version
|
|
337
|
+
in: path
|
|
338
|
+
required: true
|
|
339
|
+
schema:
|
|
340
|
+
type: string
|
|
341
|
+
pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$"
|
|
342
|
+
get:
|
|
343
|
+
operationId: GetVersionedRecorderScript
|
|
344
|
+
security: []
|
|
345
|
+
x-mockingbird:
|
|
346
|
+
supported: true
|
|
347
|
+
parity:
|
|
348
|
+
enabled: true
|
|
349
|
+
safe: true
|
|
350
|
+
responses:
|
|
351
|
+
"200":
|
|
352
|
+
description: The versioned session recorder bundle (an inert script here)
|
|
353
|
+
content:
|
|
354
|
+
application/javascript:
|
|
355
|
+
schema:
|
|
356
|
+
type: string
|
|
357
|
+
/api/surveys:
|
|
358
|
+
get:
|
|
359
|
+
operationId: ListSurveys
|
|
360
|
+
security: []
|
|
361
|
+
x-mockingbird:
|
|
362
|
+
supported: true
|
|
363
|
+
parity:
|
|
364
|
+
enabled: true
|
|
365
|
+
safe: true
|
|
366
|
+
parameters:
|
|
367
|
+
- $ref: "#/components/parameters/TokenQuery"
|
|
368
|
+
responses:
|
|
369
|
+
"200":
|
|
370
|
+
description: No surveys
|
|
371
|
+
content:
|
|
372
|
+
application/json:
|
|
373
|
+
schema:
|
|
374
|
+
type: object
|
|
375
|
+
required: [surveys]
|
|
376
|
+
properties:
|
|
377
|
+
surveys:
|
|
378
|
+
type: array
|
|
379
|
+
maxItems: 0
|
|
380
|
+
"401":
|
|
381
|
+
description: No project API key
|
|
382
|
+
content:
|
|
383
|
+
application/json:
|
|
384
|
+
schema:
|
|
385
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
386
|
+
/api/web_experiments:
|
|
387
|
+
get:
|
|
388
|
+
operationId: ListWebExperiments
|
|
389
|
+
security: []
|
|
390
|
+
x-mockingbird:
|
|
391
|
+
supported: true
|
|
392
|
+
parity:
|
|
393
|
+
enabled: true
|
|
394
|
+
safe: true
|
|
395
|
+
parameters:
|
|
396
|
+
- $ref: "#/components/parameters/TokenQuery"
|
|
397
|
+
responses:
|
|
398
|
+
"200":
|
|
399
|
+
description: No web experiments
|
|
400
|
+
content:
|
|
401
|
+
application/json:
|
|
402
|
+
schema:
|
|
403
|
+
type: object
|
|
404
|
+
required: [experiments]
|
|
405
|
+
properties:
|
|
406
|
+
experiments:
|
|
407
|
+
type: array
|
|
408
|
+
maxItems: 0
|
|
409
|
+
"401":
|
|
410
|
+
description: No project API key
|
|
411
|
+
content:
|
|
412
|
+
application/json:
|
|
413
|
+
schema:
|
|
414
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
415
|
+
/api/projects/{projectId}/feature_flags:
|
|
416
|
+
parameters:
|
|
417
|
+
- $ref: "#/components/parameters/ProjectId"
|
|
418
|
+
get:
|
|
419
|
+
operationId: ListFeatureFlags
|
|
420
|
+
security:
|
|
421
|
+
- bearerAuth: []
|
|
422
|
+
x-mockingbird:
|
|
423
|
+
supported: true
|
|
424
|
+
parity:
|
|
425
|
+
enabled: true
|
|
426
|
+
safe: true
|
|
427
|
+
parameters:
|
|
428
|
+
- name: limit
|
|
429
|
+
in: query
|
|
430
|
+
schema:
|
|
431
|
+
type: integer
|
|
432
|
+
minimum: 1
|
|
433
|
+
maximum: 100
|
|
434
|
+
- name: offset
|
|
435
|
+
in: query
|
|
436
|
+
schema:
|
|
437
|
+
type: integer
|
|
438
|
+
minimum: 0
|
|
439
|
+
maximum: 1000
|
|
440
|
+
responses:
|
|
441
|
+
"200":
|
|
442
|
+
description: One page of flags (feature-flags-cli follows `next`)
|
|
443
|
+
content:
|
|
444
|
+
application/json:
|
|
445
|
+
schema:
|
|
446
|
+
$ref: "#/components/schemas/FeatureFlagPage"
|
|
447
|
+
"401":
|
|
448
|
+
description: No personal API key
|
|
449
|
+
content:
|
|
450
|
+
application/json:
|
|
451
|
+
schema:
|
|
452
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
453
|
+
post:
|
|
454
|
+
operationId: CreateFeatureFlag
|
|
455
|
+
security:
|
|
456
|
+
- bearerAuth: []
|
|
457
|
+
x-mockingbird:
|
|
458
|
+
supported: true
|
|
459
|
+
parity:
|
|
460
|
+
enabled: true
|
|
461
|
+
safe: false
|
|
462
|
+
requestBody:
|
|
463
|
+
required: true
|
|
464
|
+
content:
|
|
465
|
+
application/json:
|
|
466
|
+
schema:
|
|
467
|
+
$ref: "#/components/schemas/CreateFeatureFlagBody"
|
|
468
|
+
responses:
|
|
469
|
+
"201":
|
|
470
|
+
description: Created
|
|
471
|
+
content:
|
|
472
|
+
application/json:
|
|
473
|
+
schema:
|
|
474
|
+
$ref: "#/components/schemas/FeatureFlag"
|
|
475
|
+
"400":
|
|
476
|
+
description: Invalid, or the key already exists
|
|
477
|
+
content:
|
|
478
|
+
application/json:
|
|
479
|
+
schema:
|
|
480
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
481
|
+
"401":
|
|
482
|
+
description: No personal API key
|
|
483
|
+
content:
|
|
484
|
+
application/json:
|
|
485
|
+
schema:
|
|
486
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
487
|
+
/api/projects/{projectId}/feature_flags/{flagId}:
|
|
488
|
+
parameters:
|
|
489
|
+
- $ref: "#/components/parameters/ProjectId"
|
|
490
|
+
- name: flagId
|
|
491
|
+
in: path
|
|
492
|
+
required: true
|
|
493
|
+
description: >-
|
|
494
|
+
The flag's numeric id. The mock also accepts the flag key (how self-parity walks
|
|
495
|
+
reference flags they created, since resource identities are strings).
|
|
496
|
+
schema:
|
|
497
|
+
type: string
|
|
498
|
+
x-mockingbird-resource-ref:
|
|
499
|
+
type: feature_flag
|
|
500
|
+
missing: "999999"
|
|
501
|
+
patch:
|
|
502
|
+
operationId: UpdateFeatureFlag
|
|
503
|
+
security:
|
|
504
|
+
- bearerAuth: []
|
|
505
|
+
x-mockingbird:
|
|
506
|
+
supported: true
|
|
507
|
+
parity:
|
|
508
|
+
enabled: true
|
|
509
|
+
safe: false
|
|
510
|
+
requestBody:
|
|
511
|
+
required: true
|
|
512
|
+
content:
|
|
513
|
+
application/json:
|
|
514
|
+
schema:
|
|
515
|
+
$ref: "#/components/schemas/UpdateFeatureFlagBody"
|
|
516
|
+
responses:
|
|
517
|
+
"200":
|
|
518
|
+
description: Updated
|
|
519
|
+
content:
|
|
520
|
+
application/json:
|
|
521
|
+
schema:
|
|
522
|
+
$ref: "#/components/schemas/FeatureFlag"
|
|
523
|
+
"400":
|
|
524
|
+
description: Invalid
|
|
525
|
+
content:
|
|
526
|
+
application/json:
|
|
527
|
+
schema:
|
|
528
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
529
|
+
"401":
|
|
530
|
+
description: No personal API key
|
|
531
|
+
content:
|
|
532
|
+
application/json:
|
|
533
|
+
schema:
|
|
534
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
535
|
+
"404":
|
|
536
|
+
description: No such flag
|
|
537
|
+
content:
|
|
538
|
+
application/json:
|
|
539
|
+
schema:
|
|
540
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
541
|
+
/api/projects/{projectId}/query:
|
|
542
|
+
parameters:
|
|
543
|
+
- $ref: "#/components/parameters/ProjectId"
|
|
544
|
+
post:
|
|
545
|
+
operationId: RunQuery
|
|
546
|
+
description: >-
|
|
547
|
+
HogQL (the marketing-metrics crons). Answers canned results set with
|
|
548
|
+
`PUT /__admin/settings {"queryResults": [...]}`; `{results: []}` otherwise.
|
|
549
|
+
security:
|
|
550
|
+
- bearerAuth: []
|
|
551
|
+
x-mockingbird:
|
|
552
|
+
supported: true
|
|
553
|
+
parity:
|
|
554
|
+
enabled: true
|
|
555
|
+
safe: true
|
|
556
|
+
requestBody:
|
|
557
|
+
required: true
|
|
558
|
+
content:
|
|
559
|
+
application/json:
|
|
560
|
+
schema:
|
|
561
|
+
$ref: "#/components/schemas/QueryRequest"
|
|
562
|
+
responses:
|
|
563
|
+
"200":
|
|
564
|
+
description: Query results
|
|
565
|
+
content:
|
|
566
|
+
application/json:
|
|
567
|
+
schema:
|
|
568
|
+
$ref: "#/components/schemas/QueryResponse"
|
|
569
|
+
"400":
|
|
570
|
+
description: Not a HogQL query
|
|
571
|
+
content:
|
|
572
|
+
application/json:
|
|
573
|
+
schema:
|
|
574
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
575
|
+
"401":
|
|
576
|
+
description: No personal API key
|
|
577
|
+
content:
|
|
578
|
+
application/json:
|
|
579
|
+
schema:
|
|
580
|
+
$ref: "#/components/schemas/ErrorBody"
|
|
581
|
+
components:
|
|
582
|
+
securitySchemes:
|
|
583
|
+
bearerAuth:
|
|
584
|
+
type: http
|
|
585
|
+
scheme: bearer
|
|
586
|
+
parameters:
|
|
587
|
+
Version:
|
|
588
|
+
name: v
|
|
589
|
+
in: query
|
|
590
|
+
schema:
|
|
591
|
+
type: integer
|
|
592
|
+
minimum: 1
|
|
593
|
+
maximum: 4
|
|
594
|
+
Config:
|
|
595
|
+
name: config
|
|
596
|
+
in: query
|
|
597
|
+
schema:
|
|
598
|
+
type: string
|
|
599
|
+
enum: ["true", "false"]
|
|
600
|
+
TokenPath:
|
|
601
|
+
name: token
|
|
602
|
+
in: path
|
|
603
|
+
required: true
|
|
604
|
+
schema:
|
|
605
|
+
type: string
|
|
606
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
607
|
+
TokenQuery:
|
|
608
|
+
name: token
|
|
609
|
+
in: query
|
|
610
|
+
required: true
|
|
611
|
+
schema:
|
|
612
|
+
type: string
|
|
613
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
614
|
+
ProjectId:
|
|
615
|
+
name: projectId
|
|
616
|
+
in: path
|
|
617
|
+
required: true
|
|
618
|
+
schema:
|
|
619
|
+
type: integer
|
|
620
|
+
minimum: 1
|
|
621
|
+
maximum: 999999999
|
|
622
|
+
schemas:
|
|
623
|
+
ErrorBody:
|
|
624
|
+
type: object
|
|
625
|
+
required: [type, code, detail]
|
|
626
|
+
properties:
|
|
627
|
+
type:
|
|
628
|
+
type: string
|
|
629
|
+
code:
|
|
630
|
+
type: string
|
|
631
|
+
detail:
|
|
632
|
+
type: string
|
|
633
|
+
attr:
|
|
634
|
+
type: ["string", "null"]
|
|
635
|
+
FlagsRequest:
|
|
636
|
+
type: object
|
|
637
|
+
required: [distinct_id]
|
|
638
|
+
properties:
|
|
639
|
+
token:
|
|
640
|
+
type: string
|
|
641
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
642
|
+
api_key:
|
|
643
|
+
type: string
|
|
644
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
645
|
+
distinct_id:
|
|
646
|
+
type: string
|
|
647
|
+
minLength: 1
|
|
648
|
+
maxLength: 64
|
|
649
|
+
groups:
|
|
650
|
+
type: object
|
|
651
|
+
person_properties:
|
|
652
|
+
type: object
|
|
653
|
+
properties:
|
|
654
|
+
email:
|
|
655
|
+
type: string
|
|
656
|
+
maxLength: 120
|
|
657
|
+
group_properties:
|
|
658
|
+
type: object
|
|
659
|
+
$device_id:
|
|
660
|
+
type: string
|
|
661
|
+
maxLength: 64
|
|
662
|
+
$anon_distinct_id:
|
|
663
|
+
type: string
|
|
664
|
+
maxLength: 64
|
|
665
|
+
evaluation_contexts:
|
|
666
|
+
type: array
|
|
667
|
+
maxItems: 5
|
|
668
|
+
items:
|
|
669
|
+
type: string
|
|
670
|
+
maxLength: 40
|
|
671
|
+
evaluation_runtime:
|
|
672
|
+
type: string
|
|
673
|
+
enum: [server, client, all]
|
|
674
|
+
flag_keys_to_evaluate:
|
|
675
|
+
type: array
|
|
676
|
+
maxItems: 10
|
|
677
|
+
items:
|
|
678
|
+
type: string
|
|
679
|
+
maxLength: 64
|
|
680
|
+
geoip_disable:
|
|
681
|
+
type: boolean
|
|
682
|
+
disable_flags:
|
|
683
|
+
type: boolean
|
|
684
|
+
FlagDetail:
|
|
685
|
+
type: object
|
|
686
|
+
required: [key, enabled, variant, reason, metadata]
|
|
687
|
+
properties:
|
|
688
|
+
key:
|
|
689
|
+
type: string
|
|
690
|
+
enabled:
|
|
691
|
+
type: boolean
|
|
692
|
+
variant:
|
|
693
|
+
type: ["string", "null"]
|
|
694
|
+
failed:
|
|
695
|
+
type: boolean
|
|
696
|
+
reason:
|
|
697
|
+
type: object
|
|
698
|
+
required: [code, description]
|
|
699
|
+
properties:
|
|
700
|
+
code:
|
|
701
|
+
type: string
|
|
702
|
+
condition_index:
|
|
703
|
+
type: ["integer", "null"]
|
|
704
|
+
description:
|
|
705
|
+
type: string
|
|
706
|
+
metadata:
|
|
707
|
+
type: object
|
|
708
|
+
required: [id, version]
|
|
709
|
+
properties:
|
|
710
|
+
id:
|
|
711
|
+
type: integer
|
|
712
|
+
version:
|
|
713
|
+
type: integer
|
|
714
|
+
description:
|
|
715
|
+
type: ["string", "null"]
|
|
716
|
+
payload:
|
|
717
|
+
type: string
|
|
718
|
+
description: The payload as a JSON string.
|
|
719
|
+
FlagsResponse:
|
|
720
|
+
type: object
|
|
721
|
+
required: [errorsWhileComputingFlags]
|
|
722
|
+
properties:
|
|
723
|
+
flags:
|
|
724
|
+
type: object
|
|
725
|
+
additionalProperties:
|
|
726
|
+
$ref: "#/components/schemas/FlagDetail"
|
|
727
|
+
featureFlags:
|
|
728
|
+
type: object
|
|
729
|
+
additionalProperties:
|
|
730
|
+
type: ["boolean", "string"]
|
|
731
|
+
featureFlagPayloads:
|
|
732
|
+
type: object
|
|
733
|
+
additionalProperties:
|
|
734
|
+
type: string
|
|
735
|
+
errorsWhileComputingFlags:
|
|
736
|
+
type: boolean
|
|
737
|
+
quotaLimited:
|
|
738
|
+
type: array
|
|
739
|
+
items:
|
|
740
|
+
type: string
|
|
741
|
+
requestId:
|
|
742
|
+
type: string
|
|
743
|
+
x-mockingbird-volatile:
|
|
744
|
+
kind: id
|
|
745
|
+
evaluatedAt:
|
|
746
|
+
type: integer
|
|
747
|
+
x-mockingbird-volatile:
|
|
748
|
+
kind: timestamp
|
|
749
|
+
config:
|
|
750
|
+
type: object
|
|
751
|
+
supportedCompression:
|
|
752
|
+
type: array
|
|
753
|
+
items:
|
|
754
|
+
type: string
|
|
755
|
+
sessionRecording:
|
|
756
|
+
oneOf:
|
|
757
|
+
- type: boolean
|
|
758
|
+
- type: object
|
|
759
|
+
RemoteConfig:
|
|
760
|
+
type: object
|
|
761
|
+
required: [token, supportedCompression, hasFeatureFlags, analytics, sessionRecording]
|
|
762
|
+
properties:
|
|
763
|
+
token:
|
|
764
|
+
type: string
|
|
765
|
+
supportedCompression:
|
|
766
|
+
type: array
|
|
767
|
+
items:
|
|
768
|
+
type: string
|
|
769
|
+
hasFeatureFlags:
|
|
770
|
+
type: boolean
|
|
771
|
+
analytics:
|
|
772
|
+
type: object
|
|
773
|
+
required: [endpoint]
|
|
774
|
+
properties:
|
|
775
|
+
endpoint:
|
|
776
|
+
type: string
|
|
777
|
+
sessionRecording:
|
|
778
|
+
oneOf:
|
|
779
|
+
- type: boolean
|
|
780
|
+
- type: object
|
|
781
|
+
required: [endpoint]
|
|
782
|
+
properties:
|
|
783
|
+
endpoint:
|
|
784
|
+
type: string
|
|
785
|
+
surveys:
|
|
786
|
+
type: boolean
|
|
787
|
+
heatmaps:
|
|
788
|
+
type: boolean
|
|
789
|
+
siteApps:
|
|
790
|
+
type: array
|
|
791
|
+
CapturedEventBody:
|
|
792
|
+
type: object
|
|
793
|
+
required: [event]
|
|
794
|
+
properties:
|
|
795
|
+
event:
|
|
796
|
+
type: string
|
|
797
|
+
minLength: 1
|
|
798
|
+
maxLength: 64
|
|
799
|
+
distinct_id:
|
|
800
|
+
type: string
|
|
801
|
+
minLength: 1
|
|
802
|
+
maxLength: 64
|
|
803
|
+
properties:
|
|
804
|
+
type: object
|
|
805
|
+
timestamp:
|
|
806
|
+
type: string
|
|
807
|
+
format: date-time
|
|
808
|
+
uuid:
|
|
809
|
+
type: string
|
|
810
|
+
format: uuid
|
|
811
|
+
BatchRequest:
|
|
812
|
+
type: object
|
|
813
|
+
required: [api_key, batch]
|
|
814
|
+
properties:
|
|
815
|
+
api_key:
|
|
816
|
+
type: string
|
|
817
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
818
|
+
batch:
|
|
819
|
+
type: array
|
|
820
|
+
maxItems: 5
|
|
821
|
+
items:
|
|
822
|
+
$ref: "#/components/schemas/CapturedEventBody"
|
|
823
|
+
sent_at:
|
|
824
|
+
type: string
|
|
825
|
+
format: date-time
|
|
826
|
+
CaptureRequest:
|
|
827
|
+
type: object
|
|
828
|
+
required: [api_key, event]
|
|
829
|
+
properties:
|
|
830
|
+
api_key:
|
|
831
|
+
type: string
|
|
832
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
833
|
+
event:
|
|
834
|
+
type: string
|
|
835
|
+
minLength: 1
|
|
836
|
+
maxLength: 64
|
|
837
|
+
distinct_id:
|
|
838
|
+
type: string
|
|
839
|
+
minLength: 1
|
|
840
|
+
maxLength: 64
|
|
841
|
+
properties:
|
|
842
|
+
type: object
|
|
843
|
+
timestamp:
|
|
844
|
+
type: string
|
|
845
|
+
format: date-time
|
|
846
|
+
uuid:
|
|
847
|
+
type: string
|
|
848
|
+
format: uuid
|
|
849
|
+
CaptureResponse:
|
|
850
|
+
type: object
|
|
851
|
+
required: [status]
|
|
852
|
+
properties:
|
|
853
|
+
status:
|
|
854
|
+
oneOf:
|
|
855
|
+
- type: string
|
|
856
|
+
- type: integer
|
|
857
|
+
FeatureFlag:
|
|
858
|
+
type: object
|
|
859
|
+
required: [id, key, name, active, filters]
|
|
860
|
+
properties:
|
|
861
|
+
id:
|
|
862
|
+
type: integer
|
|
863
|
+
key:
|
|
864
|
+
type: string
|
|
865
|
+
x-mockingbird-resource:
|
|
866
|
+
type: feature_flag
|
|
867
|
+
identity: true
|
|
868
|
+
name:
|
|
869
|
+
type: string
|
|
870
|
+
active:
|
|
871
|
+
type: boolean
|
|
872
|
+
deleted:
|
|
873
|
+
type: boolean
|
|
874
|
+
created_at:
|
|
875
|
+
type: string
|
|
876
|
+
x-mockingbird-volatile:
|
|
877
|
+
kind: timestamp
|
|
878
|
+
updated_at:
|
|
879
|
+
type: string
|
|
880
|
+
x-mockingbird-volatile:
|
|
881
|
+
kind: timestamp
|
|
882
|
+
version:
|
|
883
|
+
type: integer
|
|
884
|
+
filters:
|
|
885
|
+
type: object
|
|
886
|
+
required: [groups]
|
|
887
|
+
properties:
|
|
888
|
+
groups:
|
|
889
|
+
type: array
|
|
890
|
+
items:
|
|
891
|
+
type: object
|
|
892
|
+
multivariate:
|
|
893
|
+
oneOf:
|
|
894
|
+
- type: "null"
|
|
895
|
+
- type: object
|
|
896
|
+
payloads:
|
|
897
|
+
type: object
|
|
898
|
+
FeatureFlagPage:
|
|
899
|
+
type: object
|
|
900
|
+
required: [count, next, previous, results]
|
|
901
|
+
properties:
|
|
902
|
+
count:
|
|
903
|
+
type: integer
|
|
904
|
+
next:
|
|
905
|
+
type: ["string", "null"]
|
|
906
|
+
x-mockingbird-volatile:
|
|
907
|
+
kind: url
|
|
908
|
+
previous:
|
|
909
|
+
type: ["string", "null"]
|
|
910
|
+
x-mockingbird-volatile:
|
|
911
|
+
kind: url
|
|
912
|
+
results:
|
|
913
|
+
type: array
|
|
914
|
+
items:
|
|
915
|
+
$ref: "#/components/schemas/FeatureFlag"
|
|
916
|
+
FlagGroup:
|
|
917
|
+
type: object
|
|
918
|
+
properties:
|
|
919
|
+
properties:
|
|
920
|
+
type: array
|
|
921
|
+
maxItems: 2
|
|
922
|
+
items:
|
|
923
|
+
type: object
|
|
924
|
+
required: [key, value]
|
|
925
|
+
properties:
|
|
926
|
+
key:
|
|
927
|
+
type: string
|
|
928
|
+
enum: [distinct_id, email]
|
|
929
|
+
type:
|
|
930
|
+
type: string
|
|
931
|
+
enum: [person]
|
|
932
|
+
operator:
|
|
933
|
+
type: string
|
|
934
|
+
enum: [exact]
|
|
935
|
+
value:
|
|
936
|
+
type: array
|
|
937
|
+
maxItems: 3
|
|
938
|
+
items:
|
|
939
|
+
type: string
|
|
940
|
+
minLength: 1
|
|
941
|
+
maxLength: 40
|
|
942
|
+
rollout_percentage:
|
|
943
|
+
type: integer
|
|
944
|
+
minimum: 0
|
|
945
|
+
maximum: 100
|
|
946
|
+
variant:
|
|
947
|
+
type: ["string", "null"]
|
|
948
|
+
maxLength: 20
|
|
949
|
+
FlagFilters:
|
|
950
|
+
type: object
|
|
951
|
+
properties:
|
|
952
|
+
groups:
|
|
953
|
+
type: array
|
|
954
|
+
maxItems: 3
|
|
955
|
+
items:
|
|
956
|
+
$ref: "#/components/schemas/FlagGroup"
|
|
957
|
+
payloads:
|
|
958
|
+
type: object
|
|
959
|
+
properties:
|
|
960
|
+
"true":
|
|
961
|
+
type: string
|
|
962
|
+
maxLength: 200
|
|
963
|
+
CreateFeatureFlagBody:
|
|
964
|
+
type: object
|
|
965
|
+
required: [key]
|
|
966
|
+
properties:
|
|
967
|
+
key:
|
|
968
|
+
type: string
|
|
969
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
970
|
+
name:
|
|
971
|
+
type: string
|
|
972
|
+
maxLength: 120
|
|
973
|
+
active:
|
|
974
|
+
type: boolean
|
|
975
|
+
filters:
|
|
976
|
+
$ref: "#/components/schemas/FlagFilters"
|
|
977
|
+
UpdateFeatureFlagBody:
|
|
978
|
+
type: object
|
|
979
|
+
properties:
|
|
980
|
+
name:
|
|
981
|
+
type: string
|
|
982
|
+
maxLength: 120
|
|
983
|
+
active:
|
|
984
|
+
type: boolean
|
|
985
|
+
deleted:
|
|
986
|
+
type: boolean
|
|
987
|
+
filters:
|
|
988
|
+
$ref: "#/components/schemas/FlagFilters"
|
|
989
|
+
QueryRequest:
|
|
990
|
+
type: object
|
|
991
|
+
required: [query]
|
|
992
|
+
properties:
|
|
993
|
+
query:
|
|
994
|
+
type: object
|
|
995
|
+
required: [kind, query]
|
|
996
|
+
properties:
|
|
997
|
+
kind:
|
|
998
|
+
type: string
|
|
999
|
+
enum: [HogQLQuery]
|
|
1000
|
+
query:
|
|
1001
|
+
type: string
|
|
1002
|
+
minLength: 1
|
|
1003
|
+
maxLength: 500
|
|
1004
|
+
QueryResponse:
|
|
1005
|
+
type: object
|
|
1006
|
+
required: [results]
|
|
1007
|
+
properties:
|
|
1008
|
+
results:
|
|
1009
|
+
type: array
|
|
1010
|
+
items:
|
|
1011
|
+
type: array
|
|
1012
|
+
columns:
|
|
1013
|
+
type: array
|
|
1014
|
+
items:
|
|
1015
|
+
type: string
|
|
1016
|
+
is_cached:
|
|
1017
|
+
type: boolean
|