@shipeasy/openapi 1.6.0 → 2.2.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-643YSMLU.js +1616 -0
  3. package/dist/chunk-643YSMLU.js.map +1 -0
  4. package/dist/chunk-MRW3DJ57.js +3385 -0
  5. package/dist/chunk-MRW3DJ57.js.map +1 -0
  6. package/dist/client-K0ShmsC7.d.ts +11284 -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 +86 -0
  11. package/dist/custom.js +300 -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 +7973 -0
  20. package/dist/schemas.js +1099 -0
  21. package/dist/schemas.js.map +1 -0
  22. package/openapi.json +15922 -3232
  23. package/openapi.yaml +14277 -0
  24. package/package.json +33 -26
  25. package/spec/components/errors.yaml +53 -0
  26. package/spec/components/parameters.yaml +32 -0
  27. package/spec/components/responses.yaml +122 -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 +92 -0
  31. package/spec/components/schemas/configs.yaml +371 -0
  32. package/spec/components/schemas/connectors.yaml +587 -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 +237 -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 +1013 -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 +367 -0
  47. package/spec/paths/alert-rules.yaml +258 -0
  48. package/spec/paths/attributes.yaml +272 -0
  49. package/spec/paths/configs.yaml +758 -0
  50. package/spec/paths/connectors.yaml +782 -0
  51. package/spec/paths/errors.yaml +382 -0
  52. package/spec/paths/events.yaml +380 -0
  53. package/spec/paths/experiments.yaml +803 -0
  54. package/spec/paths/gate-templates.yaml +267 -0
  55. package/spec/paths/gates.yaml +465 -0
  56. package/spec/paths/i18n.yaml +557 -0
  57. package/spec/paths/keys.yaml +182 -0
  58. package/spec/paths/killswitches.yaml +574 -0
  59. package/spec/paths/metrics.yaml +313 -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 +255 -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,574 @@
1
+ /api/admin/killswitches:
2
+ get:
3
+ operationId: listKillswitches
4
+ summary: List killswitches
5
+ description: |-
6
+ Returns a single page of killswitches ordered by `updated_at desc, id desc`. Each row includes the latest published `value`/`switches`/`version` per env.
7
+
8
+ **Use case:** Snapshot every killswitch in the project — e.g. to render an incident-response runbook listing every kill and its current trip state.
9
+ tags:
10
+ - Killswitch
11
+ parameters:
12
+ - $ref: ../components/parameters.yaml#/ProjectId
13
+ - $ref: ../components/parameters.yaml#/PaginationLimit
14
+ - $ref: ../components/parameters.yaml#/PaginationCursor
15
+ - $ref: ../components/parameters.yaml#/Q
16
+ responses:
17
+ "200":
18
+ description: List killswitches
19
+ content:
20
+ application/json:
21
+ schema:
22
+ $ref: ../components/schemas/killswitches.yaml#/ListKillswitchesResponse
23
+ example:
24
+ data:
25
+ - id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
26
+ name: payments.checkout
27
+ description: Master kill for the checkout flow. Trip to fall back to the legacy provider.
28
+ updatedAt: 2026-05-09T18:22:11.000Z
29
+ envs:
30
+ dev:
31
+ value: false
32
+ version: 3
33
+ publishedAt: 2026-05-09T18:22:11.000Z
34
+ stage:
35
+ value: false
36
+ version: 3
37
+ publishedAt: 2026-05-09T18:22:11.000Z
38
+ prod:
39
+ value: false
40
+ switches:
41
+ eu_region: true
42
+ version: 5
43
+ publishedAt: 2026-05-09T18:22:11.000Z
44
+ next_cursor: null
45
+ "400":
46
+ $ref: ../components/responses.yaml#/BadRequest
47
+ "401":
48
+ $ref: ../components/responses.yaml#/Unauthorized
49
+ "403":
50
+ $ref: ../components/responses.yaml#/Forbidden
51
+ "404":
52
+ $ref: ../components/responses.yaml#/NotFound
53
+ "409":
54
+ $ref: ../components/responses.yaml#/Conflict
55
+ "422":
56
+ $ref: ../components/responses.yaml#/UnprocessableEntity
57
+ x-error-codes:
58
+ - BAD_REQUEST
59
+ - UNAUTHORIZED
60
+ - FORBIDDEN
61
+ x-cli:
62
+ name: list
63
+ post:
64
+ operationId: createKillswitch
65
+ summary: Create a killswitch
66
+ description: |-
67
+ Creates a new killswitch with `value` (default `false`) applied to **every** env at version 1.
68
+
69
+ Returns `409` if `name` already exists in the project.
70
+
71
+ **Use cases**
72
+
73
+ - **Untripped create** — `{ "name": "payments.checkout" }`. Provision the kill ahead of an incident.
74
+ - **Pre-tripped** — `{ "value": true }` to ship the killswitch already engaged.
75
+ - **With switches** — seed `switches` to carve out per-region/per-tenant kills from day one.
76
+ tags:
77
+ - Killswitch
78
+ parameters:
79
+ - $ref: ../components/parameters.yaml#/ProjectId
80
+ requestBody:
81
+ required: true
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $ref: ../components/schemas/killswitches.yaml#/CreateKillswitchRequest
86
+ examples:
87
+ minimal:
88
+ summary: Minimal — name only, untripped
89
+ description: "Smallest valid body. Creates a killswitch with `value: false` on every env."
90
+ value:
91
+ name: payments.checkout
92
+ preTripped:
93
+ summary: Pre-tripped on create
94
+ description: "Ship the killswitch already tripped (`value: true`) — useful when provisioning a kill ahead of a deploy you want to ship with the feature off."
95
+ value:
96
+ name: payments.checkout
97
+ description: Master kill for the new checkout flow.
98
+ value: true
99
+ withSwitches:
100
+ summary: With per-region switches
101
+ description: Seed a `switches` map so specific named call sites can be tripped independently of the flat `value`.
102
+ value:
103
+ name: payments.checkout
104
+ value: false
105
+ switches:
106
+ eu_region: true
107
+ apac_region: false
108
+ responses:
109
+ "201":
110
+ description: Create a killswitch
111
+ content:
112
+ application/json:
113
+ schema:
114
+ $ref: ../components/schemas/killswitches.yaml#/CreateKillswitchResponse
115
+ example:
116
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
117
+ name: payments.checkout
118
+ links:
119
+ GetKillswitch:
120
+ operationId: getKillswitch
121
+ parameters: { id: $response.body#/id }
122
+ UpdateKillswitch:
123
+ operationId: updateKillswitch
124
+ parameters: { id: $response.body#/id }
125
+ SetKillswitchSwitch:
126
+ operationId: setKillswitchSwitch
127
+ parameters: { id: $response.body#/id }
128
+ SetKillswitchValue:
129
+ operationId: setKillswitchValue
130
+ parameters: { id: $response.body#/id }
131
+ DeleteKillswitch:
132
+ operationId: deleteKillswitch
133
+ parameters: { id: $response.body#/id }
134
+ "400":
135
+ $ref: ../components/responses.yaml#/BadRequest
136
+ "401":
137
+ $ref: ../components/responses.yaml#/Unauthorized
138
+ "403":
139
+ $ref: ../components/responses.yaml#/Forbidden
140
+ "404":
141
+ $ref: ../components/responses.yaml#/NotFound
142
+ "409":
143
+ $ref: ../components/responses.yaml#/Conflict
144
+ "422":
145
+ $ref: ../components/responses.yaml#/UnprocessableEntity
146
+ x-error-codes:
147
+ - BAD_REQUEST
148
+ - UNAUTHORIZED
149
+ - FORBIDDEN
150
+ - ALREADY_EXISTS
151
+ - VALIDATION
152
+ x-cli:
153
+ name: create
154
+ positional:
155
+ - name
156
+ /api/admin/killswitches/{id}:
157
+ get:
158
+ operationId: getKillswitch
159
+ summary: Get one killswitch
160
+ description: |-
161
+ Returns the killswitch metadata plus the latest published `value`/`switches`/`version` per env.
162
+
163
+ **Use case:** Fetch the current state of one killswitch — e.g. to verify a trip propagated before declaring an incident mitigated.
164
+ tags:
165
+ - Killswitch
166
+ parameters:
167
+ - $ref: ../components/parameters.yaml#/ProjectId
168
+ - name: id
169
+ in: path
170
+ required: true
171
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
172
+ schema:
173
+ $ref: ../components/schemas/common.yaml#/ResourceId
174
+ responses:
175
+ "200":
176
+ description: Get one killswitch
177
+ content:
178
+ application/json:
179
+ schema:
180
+ $ref: ../components/schemas/killswitches.yaml#/GetKillswitchResponse
181
+ example:
182
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
183
+ name: payments.checkout
184
+ description: Master kill for the checkout flow. Trip to fall back to the legacy provider.
185
+ updatedAt: 2026-05-09T18:22:11.000Z
186
+ envs:
187
+ dev:
188
+ value: false
189
+ version: 3
190
+ publishedAt: 2026-05-09T18:22:11.000Z
191
+ stage:
192
+ value: false
193
+ version: 3
194
+ publishedAt: 2026-05-09T18:22:11.000Z
195
+ prod:
196
+ value: false
197
+ switches:
198
+ eu_region: true
199
+ version: 5
200
+ publishedAt: 2026-05-09T18:22:11.000Z
201
+ "400":
202
+ $ref: ../components/responses.yaml#/BadRequest
203
+ "401":
204
+ $ref: ../components/responses.yaml#/Unauthorized
205
+ "403":
206
+ $ref: ../components/responses.yaml#/Forbidden
207
+ "404":
208
+ $ref: ../components/responses.yaml#/NotFound
209
+ "409":
210
+ $ref: ../components/responses.yaml#/Conflict
211
+ "422":
212
+ $ref: ../components/responses.yaml#/UnprocessableEntity
213
+ x-error-codes:
214
+ - BAD_REQUEST
215
+ - UNAUTHORIZED
216
+ - FORBIDDEN
217
+ - NOT_FOUND
218
+ x-cli:
219
+ name: get
220
+ positional:
221
+ - id
222
+ patch:
223
+ operationId: updateKillswitch
224
+ summary: Update a killswitch
225
+ description: |-
226
+ Partial update applied to **every** env. Setting `value`/`switches` publishes a new version per env. Description-only patches don't bump versions.
227
+
228
+ To change a single switch on a single env, use `PUT /{id}/switch` instead.
229
+
230
+ **Use cases**
231
+
232
+ - **Trip everywhere** — `{ "value": true }`. Kills the feature across dev/stage/prod in one call.
233
+ - **Untrip everywhere** — `{ "value": false }`.
234
+ - **Replace switches** — send the full new map; per-key edits use `PUT /{id}/switch`.
235
+ - **Update description** — metadata-only patches don't bump versions.
236
+ tags:
237
+ - Killswitch
238
+ parameters:
239
+ - $ref: ../components/parameters.yaml#/ProjectId
240
+ - name: id
241
+ in: path
242
+ required: true
243
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
244
+ schema:
245
+ $ref: ../components/schemas/common.yaml#/ResourceId
246
+ requestBody:
247
+ required: true
248
+ content:
249
+ application/json:
250
+ schema:
251
+ $ref: ../components/schemas/killswitches.yaml#/UpdateKillswitchRequest
252
+ examples:
253
+ trip:
254
+ summary: Trip the killswitch on every env
255
+ description: "Sets `value: true` on dev/stage/prod, bumping each env's version by one."
256
+ value:
257
+ value: true
258
+ untrip:
259
+ summary: Untrip on every env
260
+ description: "Sets `value: false` on every env."
261
+ value:
262
+ value: false
263
+ replaceSwitches:
264
+ summary: Replace switches map
265
+ description: Replaces the per-key overrides wholesale on every env. Pass `{}` to clear.
266
+ value:
267
+ switches:
268
+ eu_region: true
269
+ apac_region: true
270
+ updateDescription:
271
+ summary: Description-only update
272
+ description: Doesn't bump versions or trigger a republish — only metadata changes.
273
+ value:
274
+ description: "Master kill — owner: payments-platform"
275
+ responses:
276
+ "200":
277
+ description: Update a killswitch
278
+ content:
279
+ application/json:
280
+ schema:
281
+ $ref: ../components/schemas/killswitches.yaml#/UpdateKillswitchResponse
282
+ example:
283
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
284
+ "400":
285
+ $ref: ../components/responses.yaml#/BadRequest
286
+ "401":
287
+ $ref: ../components/responses.yaml#/Unauthorized
288
+ "403":
289
+ $ref: ../components/responses.yaml#/Forbidden
290
+ "404":
291
+ $ref: ../components/responses.yaml#/NotFound
292
+ "409":
293
+ $ref: ../components/responses.yaml#/Conflict
294
+ "422":
295
+ $ref: ../components/responses.yaml#/UnprocessableEntity
296
+ x-error-codes:
297
+ - BAD_REQUEST
298
+ - UNAUTHORIZED
299
+ - FORBIDDEN
300
+ - NOT_FOUND
301
+ - VALIDATION
302
+ x-cli:
303
+ name: update
304
+ positional:
305
+ - id
306
+ delete:
307
+ operationId: deleteKillswitch
308
+ summary: Delete a killswitch
309
+ description: |-
310
+ Soft-deletes the killswitch and rebuilds the project's flags KV blob so SDKs stop seeing it.
311
+
312
+ **Use case:** Tear down a killswitch after the feature it protected has been removed.
313
+ tags:
314
+ - Killswitch
315
+ parameters:
316
+ - $ref: ../components/parameters.yaml#/ProjectId
317
+ - name: id
318
+ in: path
319
+ required: true
320
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
321
+ schema:
322
+ $ref: ../components/schemas/common.yaml#/ResourceId
323
+ responses:
324
+ "200":
325
+ description: Delete a killswitch
326
+ content:
327
+ application/json:
328
+ schema:
329
+ $ref: ../components/schemas/killswitches.yaml#/DeleteKillswitchResponse
330
+ example:
331
+ ok: true
332
+ "400":
333
+ $ref: ../components/responses.yaml#/BadRequest
334
+ "401":
335
+ $ref: ../components/responses.yaml#/Unauthorized
336
+ "403":
337
+ $ref: ../components/responses.yaml#/Forbidden
338
+ "404":
339
+ $ref: ../components/responses.yaml#/NotFound
340
+ "409":
341
+ $ref: ../components/responses.yaml#/Conflict
342
+ "422":
343
+ $ref: ../components/responses.yaml#/UnprocessableEntity
344
+ x-error-codes:
345
+ - BAD_REQUEST
346
+ - UNAUTHORIZED
347
+ - FORBIDDEN
348
+ - NOT_FOUND
349
+ x-cli:
350
+ name: archive
351
+ positional:
352
+ - id
353
+ /api/admin/killswitches/{id}/switch:
354
+ put:
355
+ operationId: setKillswitchSwitch
356
+ summary: Set one switch entry
357
+ description: |-
358
+ Sets or updates a single `switchKey` on a single `env`. Publishes one new version on that env only — other envs untouched.
359
+
360
+ Use this for surgical per-env, per-key flips during incident response (e.g. trip `eu_region` on prod without touching the flat `value` or other envs).
361
+
362
+ **Use cases**
363
+
364
+ - **Trip a region** — `{ "env": "prod", "switchKey": "eu_region", "value": true }`.
365
+ - **Untrip without removing** — same payload with `value: false`. To remove the entry entirely use `DELETE /{id}/switch`.
366
+ tags:
367
+ - Killswitch
368
+ parameters:
369
+ - $ref: ../components/parameters.yaml#/ProjectId
370
+ - name: id
371
+ in: path
372
+ required: true
373
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
374
+ schema:
375
+ $ref: ../components/schemas/common.yaml#/ResourceId
376
+ requestBody:
377
+ required: true
378
+ content:
379
+ application/json:
380
+ schema:
381
+ $ref: ../components/schemas/killswitches.yaml#/SetKillswitchSwitchRequest
382
+ examples:
383
+ tripRegion:
384
+ summary: Trip eu_region on prod
385
+ description: Sets `switches.eu_region = true` on prod only. Other envs and the flat `value` are unchanged.
386
+ value:
387
+ env: prod
388
+ switchKey: eu_region
389
+ value: true
390
+ untripRegion:
391
+ summary: Untrip eu_region on prod
392
+ description: Flip the same entry back off without removing it from the map.
393
+ value:
394
+ env: prod
395
+ switchKey: eu_region
396
+ value: false
397
+ responses:
398
+ "200":
399
+ description: Set one switch entry
400
+ content:
401
+ application/json:
402
+ schema:
403
+ $ref: ../components/schemas/killswitches.yaml#/SetKillswitchSwitchResponse
404
+ example:
405
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
406
+ env: prod
407
+ switchKey: eu_region
408
+ value: true
409
+ "400":
410
+ $ref: ../components/responses.yaml#/BadRequest
411
+ "401":
412
+ $ref: ../components/responses.yaml#/Unauthorized
413
+ "403":
414
+ $ref: ../components/responses.yaml#/Forbidden
415
+ "404":
416
+ $ref: ../components/responses.yaml#/NotFound
417
+ "409":
418
+ $ref: ../components/responses.yaml#/Conflict
419
+ "422":
420
+ $ref: ../components/responses.yaml#/UnprocessableEntity
421
+ x-error-codes:
422
+ - BAD_REQUEST
423
+ - UNAUTHORIZED
424
+ - FORBIDDEN
425
+ - NOT_FOUND
426
+ - VALIDATION
427
+ x-cli:
428
+ name: set
429
+ positional:
430
+ - id
431
+ delete:
432
+ operationId: unsetKillswitchSwitch
433
+ summary: Remove one switch entry
434
+ description: |-
435
+ Removes a single `switchKey` from the `switches` map on a single `env`. Publishes a new version on that env.
436
+
437
+ Returns `{ removed: false }` if the entry didn't exist (idempotent no-op).
438
+
439
+ **Use case:** Clean up a per-region override after the incident is resolved so the flat `value` governs again.
440
+ tags:
441
+ - Killswitch
442
+ parameters:
443
+ - $ref: ../components/parameters.yaml#/ProjectId
444
+ - name: id
445
+ in: path
446
+ required: true
447
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
448
+ schema:
449
+ $ref: ../components/schemas/common.yaml#/ResourceId
450
+ requestBody:
451
+ required: true
452
+ content:
453
+ application/json:
454
+ schema:
455
+ $ref: ../components/schemas/killswitches.yaml#/UnsetKillswitchSwitchRequest
456
+ examples:
457
+ removeRegion:
458
+ summary: Remove eu_region from prod
459
+ description: Drops the `eu_region` override on prod so the flat `value` applies again.
460
+ value:
461
+ env: prod
462
+ switchKey: eu_region
463
+ responses:
464
+ "200":
465
+ description: Remove one switch entry
466
+ content:
467
+ application/json:
468
+ schema:
469
+ $ref: ../components/schemas/killswitches.yaml#/UnsetKillswitchSwitchResponse
470
+ example:
471
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
472
+ env: prod
473
+ switchKey: eu_region
474
+ removed: true
475
+ "400":
476
+ $ref: ../components/responses.yaml#/BadRequest
477
+ "401":
478
+ $ref: ../components/responses.yaml#/Unauthorized
479
+ "403":
480
+ $ref: ../components/responses.yaml#/Forbidden
481
+ "404":
482
+ $ref: ../components/responses.yaml#/NotFound
483
+ "409":
484
+ $ref: ../components/responses.yaml#/Conflict
485
+ "422":
486
+ $ref: ../components/responses.yaml#/UnprocessableEntity
487
+ x-error-codes:
488
+ - BAD_REQUEST
489
+ - UNAUTHORIZED
490
+ - FORBIDDEN
491
+ - NOT_FOUND
492
+ x-cli:
493
+ name: unset
494
+ positional:
495
+ - id
496
+ /api/admin/killswitches/{id}/value:
497
+ put:
498
+ operationId: setKillswitchValue
499
+ summary: Set the flat value on one env
500
+ description: |-
501
+ Sets the flat `value` on a single `env`, publishing one new version on that env only. `switches` and other envs are untouched.
502
+
503
+ Use this to trip (or untrip) a killswitch on one environment without replacing its per-key overrides.
504
+
505
+ **Use cases**
506
+
507
+ - **Trip on prod** — `{ "env": "prod", "value": true }`.
508
+ - **Untrip on prod** — `{ "env": "prod", "value": false }`.
509
+ tags:
510
+ - Killswitch
511
+ parameters:
512
+ - $ref: ../components/parameters.yaml#/ProjectId
513
+ - name: id
514
+ in: path
515
+ required: true
516
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
517
+ schema:
518
+ $ref: ../components/schemas/common.yaml#/ResourceId
519
+ requestBody:
520
+ required: true
521
+ content:
522
+ application/json:
523
+ schema:
524
+ $ref: ../components/schemas/killswitches.yaml#/SetKillswitchValueRequest
525
+ examples:
526
+ tripProd:
527
+ summary: Trip on prod
528
+ description: "Publishes `value: true` on prod only, bumping that env's version."
529
+ value:
530
+ env: prod
531
+ value: true
532
+ untripProd:
533
+ summary: Untrip on prod
534
+ description: "Publishes `value: false` on prod only."
535
+ value:
536
+ env: prod
537
+ value: false
538
+ responses:
539
+ "200":
540
+ description: Set the flat value on one env
541
+ content:
542
+ application/json:
543
+ schema:
544
+ $ref: ../components/schemas/killswitches.yaml#/SetKillswitchValueResponse
545
+ example:
546
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
547
+ env: prod
548
+ version: 6
549
+ published:
550
+ value: true
551
+ switches:
552
+ eu_region: true
553
+ "400":
554
+ $ref: ../components/responses.yaml#/BadRequest
555
+ "401":
556
+ $ref: ../components/responses.yaml#/Unauthorized
557
+ "403":
558
+ $ref: ../components/responses.yaml#/Forbidden
559
+ "404":
560
+ $ref: ../components/responses.yaml#/NotFound
561
+ "409":
562
+ $ref: ../components/responses.yaml#/Conflict
563
+ "422":
564
+ $ref: ../components/responses.yaml#/UnprocessableEntity
565
+ x-error-codes:
566
+ - BAD_REQUEST
567
+ - UNAUTHORIZED
568
+ - FORBIDDEN
569
+ - NOT_FOUND
570
+ - VALIDATION
571
+ x-cli:
572
+ name: set-value
573
+ positional:
574
+ - id