@shipeasy/openapi 1.6.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.
Files changed (151) hide show
  1. package/README.md +37 -0
  2. package/dist/chunk-EPLLHLZN.js +1616 -0
  3. package/dist/chunk-EPLLHLZN.js.map +1 -0
  4. package/dist/chunk-SPH5HWCD.js +3326 -0
  5. package/dist/chunk-SPH5HWCD.js.map +1 -0
  6. package/dist/client-pVkoo3Bf.d.ts +11186 -0
  7. package/dist/client.d.ts +1 -0
  8. package/dist/client.js +215 -0
  9. package/dist/client.js.map +1 -0
  10. package/dist/custom.d.ts +64 -0
  11. package/dist/custom.js +292 -0
  12. package/dist/custom.js.map +1 -0
  13. package/dist/index.d.ts +29 -41
  14. package/dist/index.js +258 -4375
  15. package/dist/index.js.map +1 -0
  16. package/dist/node-context.d.ts +81 -33
  17. package/dist/node-context.js +98 -44
  18. package/dist/node-context.js.map +1 -0
  19. package/dist/schemas.d.ts +7920 -0
  20. package/dist/schemas.js +1083 -0
  21. package/dist/schemas.js.map +1 -0
  22. package/openapi.json +15297 -3044
  23. package/openapi.yaml +13979 -0
  24. package/package.json +33 -26
  25. package/spec/components/errors.yaml +53 -0
  26. package/spec/components/parameters.yaml +24 -0
  27. package/spec/components/responses.yaml +107 -0
  28. package/spec/components/schemas/alert-rules.yaml +175 -0
  29. package/spec/components/schemas/attributes.yaml +157 -0
  30. package/spec/components/schemas/common.yaml +87 -0
  31. package/spec/components/schemas/configs.yaml +371 -0
  32. package/spec/components/schemas/connectors.yaml +593 -0
  33. package/spec/components/schemas/errors-api.yaml +209 -0
  34. package/spec/components/schemas/events.yaml +321 -0
  35. package/spec/components/schemas/experiments.yaml +865 -0
  36. package/spec/components/schemas/gate-templates.yaml +198 -0
  37. package/spec/components/schemas/gates.yaml +890 -0
  38. package/spec/components/schemas/i18n.yaml +478 -0
  39. package/spec/components/schemas/keys.yaml +186 -0
  40. package/spec/components/schemas/killswitches.yaml +309 -0
  41. package/spec/components/schemas/metrics.yaml +547 -0
  42. package/spec/components/schemas/ops.yaml +1011 -0
  43. package/spec/components/schemas/projects.yaml +222 -0
  44. package/spec/components/schemas/search.yaml +46 -0
  45. package/spec/components/schemas/universes.yaml +127 -0
  46. package/spec/openapi.yaml +348 -0
  47. package/spec/paths/alert-rules.yaml +250 -0
  48. package/spec/paths/attributes.yaml +261 -0
  49. package/spec/paths/configs.yaml +744 -0
  50. package/spec/paths/connectors.yaml +748 -0
  51. package/spec/paths/errors.yaml +382 -0
  52. package/spec/paths/events.yaml +366 -0
  53. package/spec/paths/experiments.yaml +777 -0
  54. package/spec/paths/gate-templates.yaml +263 -0
  55. package/spec/paths/gates.yaml +451 -0
  56. package/spec/paths/i18n.yaml +544 -0
  57. package/spec/paths/keys.yaml +181 -0
  58. package/spec/paths/killswitches.yaml +557 -0
  59. package/spec/paths/metrics.yaml +302 -0
  60. package/spec/paths/ops.yaml +446 -0
  61. package/spec/paths/projects.yaml +210 -0
  62. package/spec/paths/search.yaml +62 -0
  63. package/spec/paths/universes.yaml +247 -0
  64. package/dist/operations/attributes.d.ts +0 -33
  65. package/dist/operations/attributes.js +0 -16
  66. package/dist/operations/cli-adapter.d.ts +0 -35
  67. package/dist/operations/cli-adapter.js +0 -91
  68. package/dist/operations/coerce.d.ts +0 -32
  69. package/dist/operations/coerce.js +0 -53
  70. package/dist/operations/configs.d.ts +0 -28
  71. package/dist/operations/configs.js +0 -119
  72. package/dist/operations/docs.d.ts +0 -37
  73. package/dist/operations/docs.js +0 -39
  74. package/dist/operations/events.d.ts +0 -28
  75. package/dist/operations/events.js +0 -121
  76. package/dist/operations/experiments.d.ts +0 -28
  77. package/dist/operations/experiments.js +0 -280
  78. package/dist/operations/gates.d.ts +0 -28
  79. package/dist/operations/gates.js +0 -132
  80. package/dist/operations/i18n.d.ts +0 -28
  81. package/dist/operations/i18n.js +0 -121
  82. package/dist/operations/index.d.ts +0 -63
  83. package/dist/operations/index.js +0 -1751
  84. package/dist/operations/killswitches.d.ts +0 -28
  85. package/dist/operations/killswitches.js +0 -126
  86. package/dist/operations/mcp-adapter.d.ts +0 -35
  87. package/dist/operations/mcp-adapter.js +0 -94
  88. package/dist/operations/metrics.d.ts +0 -30
  89. package/dist/operations/metrics.js +0 -114
  90. package/dist/operations/ops.d.ts +0 -28
  91. package/dist/operations/ops.js +0 -313
  92. package/dist/operations/projects.d.ts +0 -28
  93. package/dist/operations/projects.js +0 -36
  94. package/dist/operations/sdk-docs.d.ts +0 -28
  95. package/dist/operations/sdk-docs.js +0 -160
  96. package/dist/operations/types.d.ts +0 -138
  97. package/dist/operations/types.js +0 -9
  98. package/dist/operations/universes.d.ts +0 -28
  99. package/dist/operations/universes.js +0 -93
  100. package/dist/operations/util.d.ts +0 -33
  101. package/dist/operations/util.js +0 -9
  102. package/dist/resources/alert-rules.d.ts +0 -50
  103. package/dist/resources/alert-rules.js +0 -75
  104. package/dist/resources/attributes.d.ts +0 -19
  105. package/dist/resources/attributes.js +0 -10
  106. package/dist/resources/configs.d.ts +0 -681
  107. package/dist/resources/configs.js +0 -509
  108. package/dist/resources/events.d.ts +0 -61
  109. package/dist/resources/events.js +0 -42
  110. package/dist/resources/experiments.d.ts +0 -849
  111. package/dist/resources/experiments.js +0 -707
  112. package/dist/resources/gates.d.ts +0 -808
  113. package/dist/resources/gates.js +0 -522
  114. package/dist/resources/i18n.d.ts +0 -84
  115. package/dist/resources/i18n.js +0 -60
  116. package/dist/resources/index.d.ts +0 -2767
  117. package/dist/resources/index.js +0 -2563
  118. package/dist/resources/killswitches.d.ts +0 -436
  119. package/dist/resources/killswitches.js +0 -514
  120. package/dist/resources/metrics.d.ts +0 -54
  121. package/dist/resources/metrics.js +0 -40
  122. package/dist/resources/ops.d.ts +0 -88
  123. package/dist/resources/ops.js +0 -36
  124. package/dist/resources/projects.d.ts +0 -54
  125. package/dist/resources/projects.js +0 -14
  126. package/dist/resources/universes.d.ts +0 -185
  127. package/dist/resources/universes.js +0 -234
  128. package/dist/schemas/alert-rules.d.ts +0 -65
  129. package/dist/schemas/alert-rules.js +0 -37
  130. package/dist/schemas/configs.d.ts +0 -154
  131. package/dist/schemas/configs.js +0 -134
  132. package/dist/schemas/constants.d.ts +0 -6
  133. package/dist/schemas/constants.js +0 -7
  134. package/dist/schemas/experiments.d.ts +0 -229
  135. package/dist/schemas/experiments.js +0 -221
  136. package/dist/schemas/folder.d.ts +0 -10
  137. package/dist/schemas/folder.js +0 -8
  138. package/dist/schemas/gates.d.ts +0 -386
  139. package/dist/schemas/gates.js +0 -190
  140. package/dist/schemas/index.d.ts +0 -11
  141. package/dist/schemas/index.js +0 -762
  142. package/dist/schemas/killswitches.d.ts +0 -110
  143. package/dist/schemas/killswitches.js +0 -226
  144. package/dist/schemas/metric-name.d.ts +0 -5
  145. package/dist/schemas/metric-name.js +0 -6
  146. package/dist/schemas/pagination.d.ts +0 -37
  147. package/dist/schemas/pagination.js +0 -44
  148. package/dist/schemas/universes.d.ts +0 -35
  149. package/dist/schemas/universes.js +0 -55
  150. package/dist/transport.d.ts +0 -30
  151. package/dist/transport.js +0 -44
@@ -0,0 +1,865 @@
1
+ ListExperimentsResponse:
2
+ type: object
3
+ properties:
4
+ data:
5
+ type: array
6
+ items:
7
+ type: object
8
+ properties:
9
+ id:
10
+ type: string
11
+ description: Stable opaque experiment id (`exp_…`).
12
+ name:
13
+ type: string
14
+ maxLength: 128
15
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
16
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
17
+ description:
18
+ anyOf:
19
+ - type: string
20
+ - type: "null"
21
+ hypothesis:
22
+ anyOf:
23
+ - type: string
24
+ - type: "null"
25
+ tag:
26
+ anyOf:
27
+ - type: string
28
+ - type: "null"
29
+ ownerEmail:
30
+ anyOf:
31
+ - type: string
32
+ - type: "null"
33
+ audience:
34
+ anyOf:
35
+ - type: string
36
+ - type: "null"
37
+ bucketBy:
38
+ anyOf:
39
+ - type: string
40
+ minLength: 1
41
+ maxLength: 128
42
+ pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
43
+ description: User-attribute name used as the bucketing key — e.g. `user_id` (default), `session_id`, `device_id`, or a custom attribute like `company_id` to keep a whole org on one variant. Defaults to `user_id` when omitted.
44
+ - type: "null"
45
+ folder:
46
+ anyOf:
47
+ - type: string
48
+ - type: "null"
49
+ status:
50
+ type: string
51
+ enum:
52
+ - draft
53
+ - running
54
+ - stopped
55
+ - archived
56
+ universe:
57
+ type: string
58
+ description: Universe name this experiment draws from.
59
+ targetingGate:
60
+ anyOf:
61
+ - type: string
62
+ - type: "null"
63
+ allocationPct:
64
+ type: integer
65
+ minimum: -9007199254740991
66
+ maximum: 9007199254740991
67
+ description: Allocation in basis points (0–10000).
68
+ salt:
69
+ type: string
70
+ params:
71
+ type: object
72
+ additionalProperties:
73
+ type: string
74
+ enum:
75
+ - string
76
+ - bool
77
+ - number
78
+ groups:
79
+ type: array
80
+ items:
81
+ type: object
82
+ properties:
83
+ name:
84
+ type: string
85
+ minLength: 1
86
+ maxLength: 64
87
+ description: Group label (e.g. `control`, `treatment_a`). Max 64 chars.
88
+ weight:
89
+ type: integer
90
+ minimum: 0
91
+ maximum: 10000
92
+ description: Allocation weight in basis points (0–10000). The sum across all groups must equal exactly **10000** (100%).
93
+ params:
94
+ default: {}
95
+ description: Per-group parameter values delivered to the SDK when a caller is hashed into this group. Keys must match the experiment's `params` schema.
96
+ type: object
97
+ additionalProperties: {}
98
+ required:
99
+ - name
100
+ - weight
101
+ additionalProperties: false
102
+ description: One variant in the experiment. Weights across all groups must sum to 10000.
103
+ significanceThreshold:
104
+ type: number
105
+ minRuntimeDays:
106
+ type: integer
107
+ minimum: -9007199254740991
108
+ maximum: 9007199254740991
109
+ minSampleSize:
110
+ type: integer
111
+ minimum: -9007199254740991
112
+ maximum: 9007199254740991
113
+ sequentialTesting:
114
+ type: boolean
115
+ startedAt:
116
+ anyOf:
117
+ - type: string
118
+ - type: "null"
119
+ description: ISO-8601 timestamp the experiment last transitioned to `running`, or `null`.
120
+ stoppedAt:
121
+ anyOf:
122
+ - type: string
123
+ - type: "null"
124
+ updatedAt:
125
+ type: string
126
+ required:
127
+ - id
128
+ - name
129
+ - description
130
+ - hypothesis
131
+ - tag
132
+ - ownerEmail
133
+ - audience
134
+ - bucketBy
135
+ - folder
136
+ - status
137
+ - universe
138
+ - targetingGate
139
+ - allocationPct
140
+ - salt
141
+ - params
142
+ - groups
143
+ - significanceThreshold
144
+ - minRuntimeDays
145
+ - minSampleSize
146
+ - sequentialTesting
147
+ - startedAt
148
+ - updatedAt
149
+ additionalProperties: false
150
+ next_cursor:
151
+ anyOf:
152
+ - type: string
153
+ - type: "null"
154
+ required:
155
+ - data
156
+ - next_cursor
157
+ additionalProperties: false
158
+ GetExperimentResponse:
159
+ type: object
160
+ properties:
161
+ id:
162
+ type: string
163
+ description: Stable opaque experiment id (`exp_…`).
164
+ name:
165
+ type: string
166
+ maxLength: 128
167
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
168
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
169
+ description:
170
+ anyOf:
171
+ - type: string
172
+ - type: "null"
173
+ hypothesis:
174
+ anyOf:
175
+ - type: string
176
+ - type: "null"
177
+ tag:
178
+ anyOf:
179
+ - type: string
180
+ - type: "null"
181
+ ownerEmail:
182
+ anyOf:
183
+ - type: string
184
+ - type: "null"
185
+ audience:
186
+ anyOf:
187
+ - type: string
188
+ - type: "null"
189
+ bucketBy:
190
+ anyOf:
191
+ - type: string
192
+ minLength: 1
193
+ maxLength: 128
194
+ pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
195
+ description: User-attribute name used as the bucketing key — e.g. `user_id` (default), `session_id`, `device_id`, or a custom attribute like `company_id` to keep a whole org on one variant. Defaults to `user_id` when omitted.
196
+ - type: "null"
197
+ folder:
198
+ anyOf:
199
+ - type: string
200
+ - type: "null"
201
+ status:
202
+ type: string
203
+ enum:
204
+ - draft
205
+ - running
206
+ - stopped
207
+ - archived
208
+ universe:
209
+ type: string
210
+ description: Universe name this experiment draws from.
211
+ targetingGate:
212
+ anyOf:
213
+ - type: string
214
+ - type: "null"
215
+ allocationPct:
216
+ type: integer
217
+ minimum: -9007199254740991
218
+ maximum: 9007199254740991
219
+ description: Allocation in basis points (0–10000).
220
+ salt:
221
+ type: string
222
+ params:
223
+ type: object
224
+ additionalProperties:
225
+ type: string
226
+ enum:
227
+ - string
228
+ - bool
229
+ - number
230
+ groups:
231
+ type: array
232
+ items:
233
+ type: object
234
+ properties:
235
+ name:
236
+ type: string
237
+ minLength: 1
238
+ maxLength: 64
239
+ description: Group label (e.g. `control`, `treatment_a`). Max 64 chars.
240
+ weight:
241
+ type: integer
242
+ minimum: 0
243
+ maximum: 10000
244
+ description: Allocation weight in basis points (0–10000). The sum across all groups must equal exactly **10000** (100%).
245
+ params:
246
+ default: {}
247
+ description: Per-group parameter values delivered to the SDK when a caller is hashed into this group. Keys must match the experiment's `params` schema.
248
+ type: object
249
+ additionalProperties: {}
250
+ required:
251
+ - name
252
+ - weight
253
+ additionalProperties: false
254
+ description: One variant in the experiment. Weights across all groups must sum to 10000.
255
+ significanceThreshold:
256
+ type: number
257
+ minRuntimeDays:
258
+ type: integer
259
+ minimum: -9007199254740991
260
+ maximum: 9007199254740991
261
+ minSampleSize:
262
+ type: integer
263
+ minimum: -9007199254740991
264
+ maximum: 9007199254740991
265
+ sequentialTesting:
266
+ type: boolean
267
+ startedAt:
268
+ anyOf:
269
+ - type: string
270
+ - type: "null"
271
+ description: ISO-8601 timestamp the experiment last transitioned to `running`, or `null`.
272
+ stoppedAt:
273
+ anyOf:
274
+ - type: string
275
+ - type: "null"
276
+ updatedAt:
277
+ type: string
278
+ required:
279
+ - id
280
+ - name
281
+ - description
282
+ - hypothesis
283
+ - tag
284
+ - ownerEmail
285
+ - audience
286
+ - bucketBy
287
+ - folder
288
+ - status
289
+ - universe
290
+ - targetingGate
291
+ - allocationPct
292
+ - salt
293
+ - params
294
+ - groups
295
+ - significanceThreshold
296
+ - minRuntimeDays
297
+ - minSampleSize
298
+ - sequentialTesting
299
+ - startedAt
300
+ - updatedAt
301
+ additionalProperties: false
302
+ CreateExperimentRequest:
303
+ type: object
304
+ properties:
305
+ name:
306
+ type: string
307
+ maxLength: 128
308
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
309
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
310
+ description:
311
+ default: null
312
+ description: Free-form description. Max 2000 chars, markdown rendered in the dashboard.
313
+ anyOf:
314
+ - type: string
315
+ maxLength: 2000
316
+ - type: "null"
317
+ hypothesis:
318
+ default: null
319
+ description: Hypothesis statement shown in the editor. Display-only.
320
+ anyOf:
321
+ - type: string
322
+ maxLength: 4000
323
+ - type: "null"
324
+ tag:
325
+ default: null
326
+ description: Short tag chip rendered next to the name. Display-only.
327
+ anyOf:
328
+ - type: string
329
+ maxLength: 64
330
+ - type: "null"
331
+ owner_email:
332
+ default: null
333
+ description: Owner email. Display-only.
334
+ anyOf:
335
+ - type: string
336
+ maxLength: 254
337
+ - type: "null"
338
+ audience:
339
+ default: null
340
+ description: Audience label shown in the editor. Display-only.
341
+ anyOf:
342
+ - type: string
343
+ maxLength: 256
344
+ - type: "null"
345
+ bucket_by:
346
+ default: null
347
+ anyOf:
348
+ - type: string
349
+ minLength: 1
350
+ maxLength: 128
351
+ pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
352
+ description: User-attribute name used as the bucketing key — e.g. `user_id` (default), `session_id`, `device_id`, or a custom attribute like `company_id` to keep a whole org on one variant. Defaults to `user_id` when omitted.
353
+ - type: "null"
354
+ folder:
355
+ $ref: ./common.yaml#/Folder
356
+ universe:
357
+ type: string
358
+ minLength: 1
359
+ description: Name of an existing universe in the project. Returns `422` if the universe doesn't exist.
360
+ targeting_gate:
361
+ default: null
362
+ description: Optional gate name. Only callers that pass the gate are enrolled in the experiment.
363
+ anyOf:
364
+ - type: string
365
+ - type: "null"
366
+ allocation_pct:
367
+ default: 0
368
+ description: Share of the (gated) audience allocated to the experiment, in basis points (0–10000 = 0%–100%). `0` = unallocated. Use `allocation_percent` (0–100) below to think in percent. Immutable while the experiment is running.
369
+ type: integer
370
+ minimum: 0
371
+ maximum: 10000
372
+ allocation_percent:
373
+ description: Allocation as a **percentage** (0–100, fractional ok). Friendlier alias for `allocation_pct`; converted to basis points server-side (e.g. `50` = 5000 bp). If both are set, `allocation_percent` wins.
374
+ type: number
375
+ minimum: 0
376
+ maximum: 100
377
+ salt:
378
+ description: Hash salt for bucketing. Auto-generated if omitted. Immutable while running.
379
+ type: string
380
+ minLength: 1
381
+ maxLength: 64
382
+ params:
383
+ default: {}
384
+ type: object
385
+ additionalProperties:
386
+ type: string
387
+ enum:
388
+ - string
389
+ - bool
390
+ - number
391
+ description: "Map of param-name → scalar type. Defines the shape of `groups[].params`. Example: `{ headline: 'string', show_cta: 'bool' }`."
392
+ groups:
393
+ minItems: 2
394
+ type: array
395
+ items:
396
+ type: object
397
+ properties:
398
+ name:
399
+ type: string
400
+ minLength: 1
401
+ maxLength: 64
402
+ description: Group label (e.g. `control`, `treatment_a`). Max 64 chars.
403
+ weight:
404
+ type: integer
405
+ minimum: 0
406
+ maximum: 10000
407
+ description: Allocation weight in basis points (0–10000). The sum across all groups must equal exactly **10000** (100%).
408
+ params:
409
+ default: {}
410
+ description: Per-group parameter values delivered to the SDK when a caller is hashed into this group. Keys must match the experiment's `params` schema.
411
+ type: object
412
+ additionalProperties: {}
413
+ required:
414
+ - name
415
+ - weight
416
+ additionalProperties: false
417
+ description: One variant in the experiment. Weights across all groups must sum to 10000.
418
+ description: Two or more variants. Weights must sum to exactly 10000 (100%). Immutable while running.
419
+ significance_threshold:
420
+ default: 0.05
421
+ description: p-value cutoff used by the analysis pass. Defaults to `0.05`. Values other than 0.05 require Pro plan or higher.
422
+ type: number
423
+ minimum: 0.0001
424
+ maximum: 0.5
425
+ min_runtime_days:
426
+ default: 0
427
+ description: Minimum days the experiment must run before results are considered conclusive.
428
+ type: integer
429
+ minimum: 0
430
+ maximum: 365
431
+ min_sample_size:
432
+ default: 100
433
+ description: Minimum exposures per group before results are considered conclusive.
434
+ type: integer
435
+ minimum: 1
436
+ maximum: 9007199254740991
437
+ sequential_testing:
438
+ default: false
439
+ description: Enable sequential testing (always-valid p-values). Requires Premium plan or higher.
440
+ type: boolean
441
+ goal_metric:
442
+ description: Single goal metric defined inline — either a DSL `query` or an `event` (+`aggregation`/`value`) the server compiles. Attaching one is required before the experiment can be started. The underlying event is auto-created if missing.
443
+ $ref: ./common.yaml#/ExperimentInlineMetric
444
+ guardrail_metrics:
445
+ default: []
446
+ description: Up to 10 guardrail metrics defined inline. Each is upserted (event + metric) and attached with role=guardrail.
447
+ maxItems: 10
448
+ type: array
449
+ items:
450
+ $ref: ./common.yaml#/ExperimentInlineMetric
451
+ required:
452
+ - name
453
+ - universe
454
+ - groups
455
+ additionalProperties: false
456
+ description: Body for `POST /api/admin/experiments`. `name`, `universe`, and `groups` (≥2, weights sum to 10000) required.
457
+ CreateExperimentResponse:
458
+ type: object
459
+ properties:
460
+ id:
461
+ type: string
462
+ description: Newly assigned experiment id.
463
+ name:
464
+ type: string
465
+ maxLength: 128
466
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
467
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
468
+ required:
469
+ - id
470
+ - name
471
+ additionalProperties: false
472
+ UpdateExperimentRequest:
473
+ type: object
474
+ properties:
475
+ name:
476
+ type: string
477
+ maxLength: 128
478
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
479
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
480
+ description:
481
+ anyOf:
482
+ - type: string
483
+ maxLength: 2000
484
+ - type: "null"
485
+ hypothesis:
486
+ anyOf:
487
+ - type: string
488
+ maxLength: 4000
489
+ - type: "null"
490
+ tag:
491
+ anyOf:
492
+ - type: string
493
+ maxLength: 64
494
+ - type: "null"
495
+ owner_email:
496
+ anyOf:
497
+ - type: string
498
+ maxLength: 254
499
+ - type: "null"
500
+ audience:
501
+ anyOf:
502
+ - type: string
503
+ maxLength: 256
504
+ - type: "null"
505
+ bucket_by:
506
+ anyOf:
507
+ - type: string
508
+ minLength: 1
509
+ maxLength: 128
510
+ pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
511
+ description: User-attribute name used as the bucketing key — e.g. `user_id` (default), `session_id`, `device_id`, or a custom attribute like `company_id` to keep a whole org on one variant. Defaults to `user_id` when omitted.
512
+ - type: "null"
513
+ folder:
514
+ $ref: ./common.yaml#/Folder
515
+ targeting_gate:
516
+ anyOf:
517
+ - type: string
518
+ - type: "null"
519
+ allocation_pct:
520
+ description: Basis-points allocation (0–10000). Use `allocation_percent` (0–100) for percent. Immutable while the experiment is running.
521
+ type: integer
522
+ minimum: 0
523
+ maximum: 10000
524
+ allocation_percent:
525
+ description: Allocation as a **percentage** (0–100). Friendlier alias for `allocation_pct`; converted to basis points server-side. Wins over `allocation_pct` if both are supplied. Immutable while running.
526
+ type: number
527
+ minimum: 0
528
+ maximum: 100
529
+ salt:
530
+ description: Hash salt. Immutable while running.
531
+ type: string
532
+ minLength: 1
533
+ maxLength: 64
534
+ universe:
535
+ description: New universe name. Immutable while running. Returns `422` if the universe doesn't exist.
536
+ type: string
537
+ params:
538
+ type: object
539
+ additionalProperties:
540
+ type: string
541
+ enum:
542
+ - string
543
+ - bool
544
+ - number
545
+ description: "Map of param-name → scalar type. Defines the shape of `groups[].params`. Example: `{ headline: 'string', show_cta: 'bool' }`."
546
+ groups:
547
+ description: Replacement groups. Weights must sum to 10000. Immutable while running.
548
+ minItems: 2
549
+ type: array
550
+ items:
551
+ type: object
552
+ properties:
553
+ name:
554
+ type: string
555
+ minLength: 1
556
+ maxLength: 64
557
+ description: Group label (e.g. `control`, `treatment_a`). Max 64 chars.
558
+ weight:
559
+ type: integer
560
+ minimum: 0
561
+ maximum: 10000
562
+ description: Allocation weight in basis points (0–10000). The sum across all groups must equal exactly **10000** (100%).
563
+ params:
564
+ default: {}
565
+ description: Per-group parameter values delivered to the SDK when a caller is hashed into this group. Keys must match the experiment's `params` schema.
566
+ type: object
567
+ additionalProperties: {}
568
+ required:
569
+ - name
570
+ - weight
571
+ additionalProperties: false
572
+ description: One variant in the experiment. Weights across all groups must sum to 10000.
573
+ significance_threshold:
574
+ type: number
575
+ minimum: 0.0001
576
+ maximum: 0.5
577
+ min_runtime_days:
578
+ type: integer
579
+ minimum: 0
580
+ maximum: 365
581
+ min_sample_size:
582
+ type: integer
583
+ minimum: 1
584
+ maximum: 9007199254740991
585
+ sequential_testing:
586
+ type: boolean
587
+ goal_metric:
588
+ description: Replaces the goal metric — DSL `query` or `event` (+`aggregation`/`value`) the server compiles (event auto-upserted).
589
+ $ref: ./common.yaml#/ExperimentInlineMetric
590
+ guardrail_metrics:
591
+ description: Replaces the guardrail set wholesale (event auto-upserted per entry).
592
+ maxItems: 10
593
+ type: array
594
+ items:
595
+ $ref: ./common.yaml#/ExperimentInlineMetric
596
+ additionalProperties: false
597
+ description: Body for `PATCH /api/admin/experiments/{id}`. Partial — only supplied fields change. `allocation_pct`, `groups`, `salt`, `universe`, `params` are immutable while the experiment is running (stop first).
598
+ UpdateExperimentResponse:
599
+ type: object
600
+ properties:
601
+ id:
602
+ type: string
603
+ description: Experiment id that was updated.
604
+ required:
605
+ - id
606
+ additionalProperties: false
607
+ DeleteExperimentResponse:
608
+ type: object
609
+ properties:
610
+ ok:
611
+ type: boolean
612
+ const: true
613
+ required:
614
+ - ok
615
+ additionalProperties: false
616
+ SetExperimentStatusRequest:
617
+ type: object
618
+ properties:
619
+ status:
620
+ type: string
621
+ enum:
622
+ - draft
623
+ - running
624
+ - stopped
625
+ - archived
626
+ description: "Target status. Allowed transitions: `draft → running`, `running → stopped`, `stopped → archived`, `draft → archived`, and `archived → draft` (restore — only if the experiment never started). Restarting an archived experiment directly is not allowed; restore it to draft first, then start."
627
+ required:
628
+ - status
629
+ additionalProperties: false
630
+ description: Body for `POST /api/admin/experiments/{id}/status`.
631
+ SetExperimentStatusResponse:
632
+ type: object
633
+ properties:
634
+ id:
635
+ type: string
636
+ status:
637
+ type: string
638
+ enum:
639
+ - draft
640
+ - running
641
+ - stopped
642
+ - archived
643
+ required:
644
+ - id
645
+ - status
646
+ additionalProperties: false
647
+ SetExperimentMetricsRequest:
648
+ type: object
649
+ properties:
650
+ metrics:
651
+ type: array
652
+ items:
653
+ type: object
654
+ properties:
655
+ metric_id:
656
+ type: string
657
+ description: Existing metric id in the project.
658
+ role:
659
+ type: string
660
+ enum:
661
+ - goal
662
+ - guardrail
663
+ - secondary
664
+ description: Metric role. `goal` drives the decision, `guardrail` blocks ship if degraded, `secondary` is informational.
665
+ required:
666
+ - metric_id
667
+ - role
668
+ additionalProperties: false
669
+ description: Replacement metrics list — replaces the current attachments wholesale.
670
+ required:
671
+ - metrics
672
+ additionalProperties: false
673
+ description: Body for `POST /api/admin/experiments/{id}/metrics`. Replaces the experiment's metric attachments wholesale. Returns `422` if any `metric_id` is unknown.
674
+ SetExperimentMetricsResponse:
675
+ type: object
676
+ properties:
677
+ id:
678
+ type: string
679
+ metrics:
680
+ type: array
681
+ items:
682
+ type: object
683
+ properties:
684
+ metric_id:
685
+ type: string
686
+ role:
687
+ type: string
688
+ enum:
689
+ - goal
690
+ - guardrail
691
+ - secondary
692
+ required:
693
+ - metric_id
694
+ - role
695
+ additionalProperties: false
696
+ required:
697
+ - id
698
+ - metrics
699
+ additionalProperties: false
700
+ GetExperimentResultsResponse:
701
+ type: object
702
+ properties:
703
+ experiment:
704
+ type: object
705
+ properties:
706
+ id:
707
+ type: string
708
+ name:
709
+ type: string
710
+ maxLength: 128
711
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
712
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
713
+ status:
714
+ type: string
715
+ enum:
716
+ - draft
717
+ - running
718
+ - stopped
719
+ - archived
720
+ required:
721
+ - id
722
+ - name
723
+ - status
724
+ additionalProperties: false
725
+ results:
726
+ type: array
727
+ items:
728
+ type: object
729
+ properties:
730
+ metric:
731
+ type: string
732
+ group_name:
733
+ type: string
734
+ ds:
735
+ type: string
736
+ description: Date slice (`YYYY-MM-DD`).
737
+ n:
738
+ anyOf:
739
+ - type: number
740
+ - type: "null"
741
+ mean:
742
+ anyOf:
743
+ - type: number
744
+ - type: "null"
745
+ delta_pct:
746
+ anyOf:
747
+ - type: number
748
+ - type: "null"
749
+ p_value:
750
+ anyOf:
751
+ - type: number
752
+ - type: "null"
753
+ srm_detected:
754
+ anyOf:
755
+ - type: number
756
+ - type: "null"
757
+ description: "`1` if sample-ratio mismatch detected, else `0`."
758
+ required:
759
+ - metric
760
+ - group_name
761
+ - ds
762
+ - n
763
+ - mean
764
+ - delta_pct
765
+ - p_value
766
+ - srm_detected
767
+ additionalProperties: false
768
+ verdict:
769
+ type: string
770
+ enum:
771
+ - ship
772
+ - hold
773
+ - wait
774
+ - invalid
775
+ - draft
776
+ description: "Server-computed decision from the goal metric + guardrails + SRM vs. the significance threshold and min runtime: `ship` (goal significant + guardrails pass), `hold` (a guardrail regressed), `wait` (inconclusive / under-powered), `invalid` (sample-ratio mismatch), `draft` (never started)."
777
+ required:
778
+ - experiment
779
+ - results
780
+ - verdict
781
+ additionalProperties: false
782
+ GetExperimentTimeseriesResponse:
783
+ type: object
784
+ properties:
785
+ experiment:
786
+ type: object
787
+ properties:
788
+ id:
789
+ type: string
790
+ name:
791
+ type: string
792
+ maxLength: 128
793
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
794
+ description: Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
795
+ status:
796
+ type: string
797
+ enum:
798
+ - draft
799
+ - running
800
+ - stopped
801
+ - archived
802
+ required:
803
+ - id
804
+ - name
805
+ - status
806
+ additionalProperties: false
807
+ series:
808
+ type: array
809
+ items:
810
+ type: object
811
+ properties:
812
+ metric:
813
+ type: string
814
+ group_name:
815
+ type: string
816
+ ds:
817
+ type: string
818
+ description: Date slice (`YYYY-MM-DD`).
819
+ n:
820
+ anyOf:
821
+ - type: number
822
+ - type: "null"
823
+ mean:
824
+ anyOf:
825
+ - type: number
826
+ - type: "null"
827
+ delta_pct:
828
+ anyOf:
829
+ - type: number
830
+ - type: "null"
831
+ p_value:
832
+ anyOf:
833
+ - type: number
834
+ - type: "null"
835
+ srm_detected:
836
+ anyOf:
837
+ - type: number
838
+ - type: "null"
839
+ description: "`1` if sample-ratio mismatch detected, else `0`."
840
+ required:
841
+ - metric
842
+ - group_name
843
+ - ds
844
+ - n
845
+ - mean
846
+ - delta_pct
847
+ - p_value
848
+ - srm_detected
849
+ additionalProperties: false
850
+ required:
851
+ - experiment
852
+ - series
853
+ additionalProperties: false
854
+ ReanalyzeExperimentResponse:
855
+ type: object
856
+ properties:
857
+ id:
858
+ type: string
859
+ queued:
860
+ type: boolean
861
+ const: true
862
+ required:
863
+ - id
864
+ - queued
865
+ additionalProperties: false