v1
latestOpenAPI 3.0.02026-07-141,4077,1665.2 MBFeature Flags
Add a variant to a feature flag
Adds a single new variant to an existing feature flag. This endpoint is additive-only: it never modifies existing variants. A request whose key already exists on the flag is rejected with 409 Conflict; a value whose type does not match the flag's value_type is rejected with 400. The server generates the variant UUID and returns it in the response body; callers (for example, the flag-migration tool) need this UUID to reference the new variant in subsequent allocation syncs.
post/api/v2/feature-flags/{feature_flag_id}/variants
Path parameters
feature_flag_idstring uuid required
Example:550e8400-e29b-41d4-a716-446655440000
The ID of the feature flag.
Request body
Example request
{
"key": "variant-abc123",
"name": "Variant ABC123",
"value": "true"
}Response
Created
Example response
{
"created_at": "2023-01-01T00:00:00Z",
"id": "550e8400-e29b-41d4-a716-446655440002",
"key": "variant-abc123",
"name": "Variant ABC123",
"updated_at": "2023-01-01T00:00:00Z",
"value": "true"
}