@@ -1966,6 +1966,15 @@ components:
19661966 example: "550e8400-e29b-41d4-a716-446655440000"
19671967 format: uuid
19681968 type: string
1969+ variant_id:
1970+ description: The ID of the variant.
1971+ in: path
1972+ name: variant_id
1973+ required: true
1974+ schema:
1975+ example: "550e8400-e29b-41d4-a716-446655440002"
1976+ format: uuid
1977+ type: string
19691978 requestBodies: {}
19701979 responses:
19711980 BadRequestResponse:
@@ -105626,6 +105635,18 @@ components:
105626105635 required:
105627105636 - data
105628105637 type: object
105638+ UpdateVariantRequest:
105639+ description: Request to update an existing variant's name and value.
105640+ properties:
105641+ name:
105642+ description: The display name of the variant.
105643+ example: "Variant ABC123 Updated"
105644+ type: string
105645+ value:
105646+ description: The value of the variant as a string.
105647+ example: "new_value"
105648+ type: string
105649+ type: object
105629105650 UpdateWorkflowRequest:
105630105651 description: A request object for updating an existing workflow.
105631105652 example:
@@ -132923,6 +132944,224 @@ paths:
132923132944 permissions:
132924132945 - feature_flag_config_write
132925132946 - feature_flag_environment_config_read
132947+ /api/v2/feature-flags/{feature_flag_id}/variants:
132948+ post:
132949+ description: |-
132950+ Adds a single new variant to an existing feature flag. This endpoint is
132951+ additive-only: it never modifies existing variants. A request whose `key`
132952+ already exists on the flag is rejected with `409 Conflict`; a `value`
132953+ whose type does not match the flag's `value_type` is rejected with `400`.
132954+ The server generates the variant UUID and returns it in the response body;
132955+ callers (for example, the flag-migration tool) need this UUID to reference
132956+ the new variant in subsequent allocation syncs.
132957+ operationId: CreateVariantForFeatureFlag
132958+ parameters:
132959+ - $ref: "#/components/parameters/feature_flag_id"
132960+ requestBody:
132961+ content:
132962+ application/json:
132963+ examples:
132964+ default:
132965+ value:
132966+ data:
132967+ attributes:
132968+ key: dark
132969+ name: Dark Theme
132970+ value: dark
132971+ type: variants
132972+ schema:
132973+ $ref: "#/components/schemas/CreateVariant"
132974+ required: true
132975+ responses:
132976+ "201":
132977+ content:
132978+ application/json:
132979+ examples:
132980+ default:
132981+ value:
132982+ data:
132983+ attributes:
132984+ created_at: "2024-01-01T00:00:00+00:00"
132985+ key: dark
132986+ name: Dark Theme
132987+ updated_at: "2024-01-01T00:00:00+00:00"
132988+ value: dark
132989+ id: "550e8400-e29b-41d4-a716-446655440002"
132990+ type: variants
132991+ schema:
132992+ $ref: "#/components/schemas/Variant"
132993+ description: Created
132994+ "400":
132995+ content:
132996+ application/json:
132997+ schema:
132998+ $ref: "#/components/schemas/APIErrorResponse"
132999+ description: Bad Request
133000+ "403":
133001+ content:
133002+ application/json:
133003+ schema:
133004+ $ref: "#/components/schemas/APIErrorResponse"
133005+ description: Forbidden
133006+ "404":
133007+ content:
133008+ application/json:
133009+ schema:
133010+ $ref: "#/components/schemas/APIErrorResponse"
133011+ description: Not Found
133012+ "409":
133013+ content:
133014+ application/json:
133015+ schema:
133016+ $ref: "#/components/schemas/APIErrorResponse"
133017+ description: Conflict - A variant with this key already exists on the flag.
133018+ "429":
133019+ $ref: "#/components/responses/TooManyRequestsResponse"
133020+ security:
133021+ - apiKeyAuth: []
133022+ appKeyAuth: []
133023+ summary: Add a variant to a feature flag
133024+ tags:
133025+ - Feature Flags
133026+ x-permission:
133027+ operator: AND
133028+ permissions:
133029+ - feature_flag_config_write
133030+ /api/v2/feature-flags/{feature_flag_id}/variants/{variant_id}:
133031+ delete:
133032+ description: |-
133033+ Deletes a variant from a feature flag.
133034+
133035+ When backend approvals are enabled and the flag requires approval, a
133036+ `FlagSuggestion` is created and returned with `201 Created` instead of
133037+ deleting the variant immediately. If a pending suggestion already exists
133038+ for this flag's variant property, the endpoint returns `409 Conflict`.
133039+ operationId: DeleteVariantFromFeatureFlag
133040+ parameters:
133041+ - $ref: "#/components/parameters/feature_flag_id"
133042+ - $ref: "#/components/parameters/variant_id"
133043+ responses:
133044+ "204":
133045+ description: No Content
133046+ "400":
133047+ content:
133048+ application/json:
133049+ schema:
133050+ $ref: "#/components/schemas/APIErrorResponse"
133051+ description: Bad Request
133052+ "403":
133053+ content:
133054+ application/json:
133055+ schema:
133056+ $ref: "#/components/schemas/APIErrorResponse"
133057+ description: Forbidden
133058+ "404":
133059+ content:
133060+ application/json:
133061+ schema:
133062+ $ref: "#/components/schemas/APIErrorResponse"
133063+ description: Not Found
133064+ "409":
133065+ content:
133066+ application/json:
133067+ schema:
133068+ $ref: "#/components/schemas/APIErrorResponse"
133069+ description: Conflict - A pending suggestion already exists for this property.
133070+ "429":
133071+ $ref: "#/components/responses/TooManyRequestsResponse"
133072+ security:
133073+ - apiKeyAuth: []
133074+ appKeyAuth: []
133075+ summary: Delete a variant
133076+ tags:
133077+ - Feature Flags
133078+ x-permission:
133079+ operator: AND
133080+ permissions:
133081+ - feature_flag_config_write
133082+ put:
133083+ description: |-
133084+ Updates the name and value of an existing variant on a feature flag.
133085+
133086+ When backend approvals are enabled and the flag requires approval, a
133087+ `FlagSuggestion` is created and returned with `201 Created` instead of
133088+ applying the change immediately. The returned suggestion `id` can be used
133089+ to approve or reject the change. If a pending suggestion already exists for
133090+ this flag's variant property, the endpoint returns `409 Conflict`.
133091+ operationId: UpdateVariantForFeatureFlag
133092+ parameters:
133093+ - $ref: "#/components/parameters/feature_flag_id"
133094+ - $ref: "#/components/parameters/variant_id"
133095+ requestBody:
133096+ content:
133097+ application/json:
133098+ examples:
133099+ default:
133100+ value:
133101+ data:
133102+ attributes:
133103+ name: Dark Theme Updated
133104+ value: dark_v2
133105+ id: "550e8400-e29b-41d4-a716-446655440002"
133106+ type: variants
133107+ schema:
133108+ $ref: "#/components/schemas/UpdateVariantRequest"
133109+ required: true
133110+ responses:
133111+ "200":
133112+ content:
133113+ application/json:
133114+ examples:
133115+ default:
133116+ value:
133117+ data:
133118+ attributes:
133119+ created_at: "2024-01-01T00:00:00+00:00"
133120+ key: dark
133121+ name: Dark Theme Updated
133122+ updated_at: "2024-06-01T00:00:00+00:00"
133123+ value: dark_v2
133124+ id: "550e8400-e29b-41d4-a716-446655440002"
133125+ type: variants
133126+ schema:
133127+ $ref: "#/components/schemas/Variant"
133128+ description: OK
133129+ "400":
133130+ content:
133131+ application/json:
133132+ schema:
133133+ $ref: "#/components/schemas/APIErrorResponse"
133134+ description: Bad Request
133135+ "403":
133136+ content:
133137+ application/json:
133138+ schema:
133139+ $ref: "#/components/schemas/APIErrorResponse"
133140+ description: Forbidden
133141+ "404":
133142+ content:
133143+ application/json:
133144+ schema:
133145+ $ref: "#/components/schemas/APIErrorResponse"
133146+ description: Not Found
133147+ "409":
133148+ content:
133149+ application/json:
133150+ schema:
133151+ $ref: "#/components/schemas/APIErrorResponse"
133152+ description: Conflict - A pending suggestion already exists for this property.
133153+ "429":
133154+ $ref: "#/components/responses/TooManyRequestsResponse"
133155+ security:
133156+ - apiKeyAuth: []
133157+ appKeyAuth: []
133158+ summary: Update a variant
133159+ tags:
133160+ - Feature Flags
133161+ x-permission:
133162+ operator: AND
133163+ permissions:
133164+ - feature_flag_config_write
132926133165 /api/v2/forms:
132927133166 get:
132928133167 description: Get all forms for the authenticated user's organization.
0 commit comments