@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,465 @@
1
+ /api/admin/gates:
2
+ get:
3
+ operationId: listGates
4
+ summary: List feature gates
5
+ description: |-
6
+ Returns a single page of gates ordered by `updated_at desc, id desc`. Use the `cursor` query parameter to paginate.
7
+
8
+ **Use case:** Snapshot every gate in the project — for example to render an admin overview or to drive a CI check that asserts no gate is left at 100% in staging.
9
+ tags:
10
+ - Flags
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 feature gates
19
+ content:
20
+ application/json:
21
+ schema:
22
+ $ref: ../components/schemas/gates.yaml#/ListGatesResponse
23
+ example:
24
+ data:
25
+ - id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
26
+ name: checkout_v2
27
+ enabled: 1
28
+ rolloutPct: 5000
29
+ rules:
30
+ - attr: country
31
+ op: in
32
+ value:
33
+ - US
34
+ - CA
35
+ - GB
36
+ - attr: plan
37
+ op: neq
38
+ value: free
39
+ salt: 9c1f4f1f2c0c4a5fa1c2b6d3e7c8e3a1
40
+ title: Checkout v2
41
+ description: New checkout flow. Pro users in US/CA/GB only.
42
+ folder: checkout
43
+ groupName: growth
44
+ ownerEmail: ana@example.com
45
+ stack: null
46
+ updatedAt: 2026-05-09T16:01:22.000Z
47
+ next_cursor: null
48
+ "400":
49
+ $ref: ../components/responses.yaml#/BadRequest
50
+ "401":
51
+ $ref: ../components/responses.yaml#/Unauthorized
52
+ "403":
53
+ $ref: ../components/responses.yaml#/Forbidden
54
+ "404":
55
+ $ref: ../components/responses.yaml#/NotFound
56
+ "409":
57
+ $ref: ../components/responses.yaml#/Conflict
58
+ "422":
59
+ $ref: ../components/responses.yaml#/UnprocessableEntity
60
+ x-error-codes:
61
+ - BAD_REQUEST
62
+ - UNAUTHORIZED
63
+ - FORBIDDEN
64
+ x-cli:
65
+ name: list
66
+ post:
67
+ operationId: createGate
68
+ summary: Create a feature gate
69
+ description: |-
70
+ Creates a new gate. Default `enabled: true` at the supplied `rollout_pct` (`0` = fully dark).
71
+
72
+ Only `name` is required. Request fields use snake_case (`owner_email`); the GET response returns camelCase (`ownerEmail`, `groupName`).
73
+
74
+ Returns `409` if `name` already exists in the project (case-sensitive).
75
+
76
+ **Use cases**
77
+
78
+ - **Dark create + ramp later** — `{ "name": "checkout_v2" }` at 0% rollout. Ramp via PATCH after deploy validation.
79
+ - **Targeted rollout** — supply `rules` to gate the caller (e.g. only `plan = pro` users) plus a `rollout_pct` to bucket within that audience.
80
+ - **Gatekeeper stack** — supply `stack` instead of `rules`/`rollout_pct` for `internal ∪ beta ∪ public` fall-through. Stack entries evaluated top-to-bottom; first match wins.
81
+ - **Dashboard metadata** — populate `title`, `description`, `folder`, `group`, `owner_email` so the admin UI is self-documenting from day one.
82
+ - **Disabled on create** — pre-provision with `enabled: false` for a future launch; flip on with `POST /{id}/enable` at go-live.
83
+ tags:
84
+ - Flags
85
+ parameters:
86
+ - $ref: ../components/parameters.yaml#/ProjectId
87
+ requestBody:
88
+ required: true
89
+ content:
90
+ application/json:
91
+ schema:
92
+ $ref: ../components/schemas/gates.yaml#/CreateGateRequest
93
+ examples:
94
+ minimal:
95
+ summary: Minimal — dark gate, name only
96
+ description: "Smallest valid body. The gate is created `enabled: true` at `rollout_pct: 0`, with no rules. Ramp it later via PATCH."
97
+ value:
98
+ name: checkout_v2
99
+ targeted:
100
+ summary: Targeted rollout — rules + percentage
101
+ description: "Gate Pro users in US/CA/GB, then hash 10% of that audience into the on-bucket (`rollout_pct: 1000` = 10.00%). Adds dashboard metadata so the gate is self-documenting."
102
+ value:
103
+ name: checkout_v2
104
+ rollout_pct: 1000
105
+ rules:
106
+ - attr: country
107
+ op: in
108
+ value:
109
+ - US
110
+ - CA
111
+ - GB
112
+ - attr: plan
113
+ op: neq
114
+ value: free
115
+ title: Checkout v2
116
+ description: New checkout flow. Pro users in US/CA/GB only.
117
+ folder: checkout
118
+ group: growth
119
+ owner_email: ana@example.com
120
+ gatekeeperStack:
121
+ summary: Gatekeeper stack — internal ∪ beta ∪ public
122
+ description: "Three-layer fall-through: employees always on, opted-in beta accounts always on, then 25% of everyone else. First match wins; evaluation stops as soon as one entry returns `true`."
123
+ value:
124
+ name: checkout_v2
125
+ title: Checkout v2
126
+ owner_email: ana@example.com
127
+ stack:
128
+ - id: 01HKJ0EMP
129
+ type: condition
130
+ name: Employees
131
+ pass: any
132
+ rules:
133
+ - attr: email
134
+ op: regex
135
+ value: "@acme\\.com$"
136
+ - id: 01HKJ0BETA
137
+ type: condition
138
+ name: Beta opt-in
139
+ pass: all
140
+ rules:
141
+ - attr: beta_opt_in
142
+ op: eq
143
+ value: true
144
+ - id: 01HKJ0PUB
145
+ type: rollout
146
+ name: Public
147
+ rolloutPct: 2500
148
+ bucketBy: userID
149
+ locked: true
150
+ disabledOnCreate:
151
+ summary: Disabled on create — provision then enable later
152
+ description: "Create with `enabled: false` so the gate evaluates to `false` for every caller until a follow-up `POST /{id}/enable`. Useful when provisioning ahead of a launch."
153
+ value:
154
+ name: checkout_v2
155
+ enabled: false
156
+ rollout_pct: 0
157
+ responses:
158
+ "201":
159
+ description: Create a feature gate
160
+ content:
161
+ application/json:
162
+ schema:
163
+ $ref: ../components/schemas/gates.yaml#/CreateGateResponse
164
+ example:
165
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
166
+ name: checkout_v2
167
+ links:
168
+ UpdateGate:
169
+ operationId: updateGate
170
+ parameters: { id: $response.body#/id }
171
+ EnableGate:
172
+ operationId: enableGate
173
+ parameters: { id: $response.body#/id }
174
+ DisableGate:
175
+ operationId: disableGate
176
+ parameters: { id: $response.body#/id }
177
+ DeleteGate:
178
+ operationId: deleteGate
179
+ parameters: { id: $response.body#/id }
180
+ "400":
181
+ $ref: ../components/responses.yaml#/BadRequest
182
+ "401":
183
+ $ref: ../components/responses.yaml#/Unauthorized
184
+ "403":
185
+ $ref: ../components/responses.yaml#/Forbidden
186
+ "404":
187
+ $ref: ../components/responses.yaml#/NotFound
188
+ "409":
189
+ $ref: ../components/responses.yaml#/Conflict
190
+ "422":
191
+ $ref: ../components/responses.yaml#/UnprocessableEntity
192
+ x-error-codes:
193
+ - BAD_REQUEST
194
+ - UNAUTHORIZED
195
+ - FORBIDDEN
196
+ - ALREADY_EXISTS
197
+ - VALIDATION
198
+ x-cli:
199
+ name: create
200
+ positional:
201
+ - name
202
+ /api/admin/gates/{id}:
203
+ patch:
204
+ operationId: updateGate
205
+ summary: Update a feature gate
206
+ description: |-
207
+ Partial update — only supplied fields change. Array fields (`rules`, `stack`) **replace** wholesale; there is no merge or append.
208
+
209
+ `name` and the gate id are immutable. The response carries only `{ id }` — re-fetch via `GET /api/admin/gates` for the new row.
210
+
211
+ **Use cases**
212
+
213
+ - **Ramp rollout** — `{ "rollout_pct": 5000 }` for 50%. Basis points (0–10000); `100` = 1%.
214
+ - **Kill switch** — `{ "enabled": false }`. Forces evaluation to `false` for every caller regardless of rules/rollout. Re-enable with `POST /{id}/enable` or `{ "enabled": true }`.
215
+ - **Modify a rule's `in` set** — send the full new `rules` array. To add `'GB'` to `['US','CA']`: `{ "rules": [{ "attr": "country", "op": "in", "value": ["US","CA","GB"] }] }`. No per-rule patch endpoint.
216
+ - **Add targeting from scratch** — `{ "rules": [{ "attr": "email", "op": "regex", "value": "@acme\\.com$" }] }`.
217
+ - **Switch to gatekeeper stack** — send a non-null `stack`. To revert to flat eval, send `{ "stack": null }`.
218
+ - **Update metadata** — any subset of `title`, `description`, `folder`, `group`, `owner_email`.
219
+ tags:
220
+ - Flags
221
+ parameters:
222
+ - $ref: ../components/parameters.yaml#/ProjectId
223
+ - name: id
224
+ in: path
225
+ required: true
226
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
227
+ schema:
228
+ $ref: ../components/schemas/common.yaml#/ResourceId
229
+ requestBody:
230
+ required: true
231
+ content:
232
+ application/json:
233
+ schema:
234
+ $ref: ../components/schemas/gates.yaml#/UpdateGateRequest
235
+ examples:
236
+ rampRollout:
237
+ summary: Ramp rollout — 0 → 50%
238
+ description: Single-field patch. `5000` basis points = 50%.
239
+ value:
240
+ rollout_pct: 5000
241
+ killSwitch:
242
+ summary: Kill switch — disable the gate
243
+ description: Forces evaluation to `false` for every caller, regardless of rules or rollout. Same effect as `POST /{id}/disable` but composable with other patches.
244
+ value:
245
+ enabled: false
246
+ extendInRule:
247
+ summary: Add a value to an `in` rule
248
+ description: Array fields replace wholesale — there is no per-rule patch. To add `'AU'` to a country whitelist that previously held `['US','CA','GB']`, send the full new `rules` array. Same pattern applies to `not_in`.
249
+ value:
250
+ rules:
251
+ - attr: country
252
+ op: in
253
+ value:
254
+ - US
255
+ - CA
256
+ - GB
257
+ - AU
258
+ - attr: plan
259
+ op: neq
260
+ value: free
261
+ replaceStack:
262
+ summary: Replace gatekeeper stack
263
+ description: 'Stack is replace-wholesale. Send the full new ordered list. Pass `"stack": null` to revert the gate to flat `rules` + `rollout_pct` evaluation.'
264
+ value:
265
+ stack:
266
+ - id: 01HKJ0EMP
267
+ type: condition
268
+ name: Employees
269
+ pass: any
270
+ rules:
271
+ - attr: email
272
+ op: regex
273
+ value: "@acme\\.com$"
274
+ - id: 01HKJ0PUB
275
+ type: rollout
276
+ name: Public
277
+ rolloutPct: 5000
278
+ locked: true
279
+ updateMetadata:
280
+ summary: Update dashboard metadata
281
+ description: Any subset of `title`, `description`, `folder`, `group`, `owner_email`. Snake-case in the request; the GET response returns camelCase (`groupName`, `ownerEmail`).
282
+ value:
283
+ title: Checkout v2 (50%)
284
+ description: Bumped to 50% after passing canary. Added AU.
285
+ folder: checkout
286
+ owner_email: ana@example.com
287
+ responses:
288
+ "200":
289
+ description: Update a feature gate
290
+ content:
291
+ application/json:
292
+ schema:
293
+ $ref: ../components/schemas/gates.yaml#/UpdateGateResponse
294
+ example:
295
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
296
+ "400":
297
+ $ref: ../components/responses.yaml#/BadRequest
298
+ "401":
299
+ $ref: ../components/responses.yaml#/Unauthorized
300
+ "403":
301
+ $ref: ../components/responses.yaml#/Forbidden
302
+ "404":
303
+ $ref: ../components/responses.yaml#/NotFound
304
+ "409":
305
+ $ref: ../components/responses.yaml#/Conflict
306
+ "422":
307
+ $ref: ../components/responses.yaml#/UnprocessableEntity
308
+ x-error-codes:
309
+ - BAD_REQUEST
310
+ - UNAUTHORIZED
311
+ - FORBIDDEN
312
+ - NOT_FOUND
313
+ - VALIDATION
314
+ x-cli:
315
+ name: update
316
+ positional:
317
+ - id
318
+ delete:
319
+ operationId: deleteGate
320
+ summary: Delete a feature gate
321
+ description: |-
322
+ Soft-deletes the gate. Returns 409 if the gate is still referenced by a running experiment as a targeting gate — stop the experiment first.
323
+
324
+ **Use case:** Tear down a gate after a feature has fully shipped and the rollout flag is no longer needed.
325
+ tags:
326
+ - Flags
327
+ parameters:
328
+ - $ref: ../components/parameters.yaml#/ProjectId
329
+ - name: id
330
+ in: path
331
+ required: true
332
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
333
+ schema:
334
+ $ref: ../components/schemas/common.yaml#/ResourceId
335
+ responses:
336
+ "200":
337
+ description: Delete a feature gate
338
+ content:
339
+ application/json:
340
+ schema:
341
+ $ref: ../components/schemas/gates.yaml#/DeleteGateResponse
342
+ example:
343
+ ok: true
344
+ "400":
345
+ $ref: ../components/responses.yaml#/BadRequest
346
+ "401":
347
+ $ref: ../components/responses.yaml#/Unauthorized
348
+ "403":
349
+ $ref: ../components/responses.yaml#/Forbidden
350
+ "404":
351
+ $ref: ../components/responses.yaml#/NotFound
352
+ "409":
353
+ $ref: ../components/responses.yaml#/Conflict
354
+ "422":
355
+ $ref: ../components/responses.yaml#/UnprocessableEntity
356
+ x-error-codes:
357
+ - BAD_REQUEST
358
+ - UNAUTHORIZED
359
+ - FORBIDDEN
360
+ - NOT_FOUND
361
+ - REFERENCED_IN_USE
362
+ x-cli:
363
+ name: archive
364
+ positional:
365
+ - id
366
+ /api/admin/gates/{id}/enable:
367
+ post:
368
+ operationId: enableGate
369
+ summary: Enable a gate
370
+ description: |-
371
+ Sets `enabled: true`. The current `rollout_pct` is preserved.
372
+
373
+ **Use case:** Re-enable a previously disabled gate without re-issuing a full update.
374
+ tags:
375
+ - Flags
376
+ parameters:
377
+ - $ref: ../components/parameters.yaml#/ProjectId
378
+ - name: id
379
+ in: path
380
+ required: true
381
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
382
+ schema:
383
+ $ref: ../components/schemas/common.yaml#/ResourceId
384
+ responses:
385
+ "200":
386
+ description: Enable a gate
387
+ content:
388
+ application/json:
389
+ schema:
390
+ $ref: ../components/schemas/gates.yaml#/EnableGateResponse
391
+ example:
392
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
393
+ enabled: true
394
+ "400":
395
+ $ref: ../components/responses.yaml#/BadRequest
396
+ "401":
397
+ $ref: ../components/responses.yaml#/Unauthorized
398
+ "403":
399
+ $ref: ../components/responses.yaml#/Forbidden
400
+ "404":
401
+ $ref: ../components/responses.yaml#/NotFound
402
+ "409":
403
+ $ref: ../components/responses.yaml#/Conflict
404
+ "422":
405
+ $ref: ../components/responses.yaml#/UnprocessableEntity
406
+ x-error-codes:
407
+ - BAD_REQUEST
408
+ - UNAUTHORIZED
409
+ - FORBIDDEN
410
+ - NOT_FOUND
411
+ - VALIDATION
412
+ x-cli:
413
+ name: enable
414
+ positional:
415
+ - id
416
+ /api/admin/gates/{id}/disable:
417
+ post:
418
+ operationId: disableGate
419
+ summary: Disable a gate
420
+ description: |-
421
+ Sets `enabled: false` so the gate evaluates to `false` for every caller, regardless of `rollout_pct` or `rules`. Use as a quick kill switch.
422
+
423
+ **Use case:** Flip a gate off in production without redeploying — the canonical kill-switch flow.
424
+ tags:
425
+ - Flags
426
+ parameters:
427
+ - $ref: ../components/parameters.yaml#/ProjectId
428
+ - name: id
429
+ in: path
430
+ required: true
431
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
432
+ schema:
433
+ $ref: ../components/schemas/common.yaml#/ResourceId
434
+ responses:
435
+ "200":
436
+ description: Disable a gate
437
+ content:
438
+ application/json:
439
+ schema:
440
+ $ref: ../components/schemas/gates.yaml#/DisableGateResponse
441
+ example:
442
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
443
+ enabled: false
444
+ "400":
445
+ $ref: ../components/responses.yaml#/BadRequest
446
+ "401":
447
+ $ref: ../components/responses.yaml#/Unauthorized
448
+ "403":
449
+ $ref: ../components/responses.yaml#/Forbidden
450
+ "404":
451
+ $ref: ../components/responses.yaml#/NotFound
452
+ "409":
453
+ $ref: ../components/responses.yaml#/Conflict
454
+ "422":
455
+ $ref: ../components/responses.yaml#/UnprocessableEntity
456
+ x-error-codes:
457
+ - BAD_REQUEST
458
+ - UNAUTHORIZED
459
+ - FORBIDDEN
460
+ - NOT_FOUND
461
+ - VALIDATION
462
+ x-cli:
463
+ name: disable
464
+ positional:
465
+ - id