v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Feature Flags

Create a feature flag

Creates a new feature flag with variants.

post/api/v2/feature-flags

Request body

Example request

{
  "data": {
    "attributes": {
      "default_variant_key": "variant-abc123",
      "description": "This is an example feature flag for demonstration",
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "name": "Feature Flag ABC123",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "key": "variant-abc123",
          "name": "Variant ABC123",
          "value": "true"
        }
      ]
    },
    "type": "feature-flags"
  }
}

Response

Created

Example response

{
  "data": {
    "attributes": {
      "archived_at": "2023-01-01T00:00:00Z",
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440010",
      "description": "This is an example feature flag for demonstration",
      "distribution_channel": "ALL",
      "feature_flag_environments": [
        {
          "default_allocation_key": "allocation-default-123abc",
          "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "environment_id": "550e8400-e29b-41d4-a716-446655440001",
          "environment_name": "env-search-term",
          "environment_queries": [
            "test-feature-flag",
            "env-search-term"
          ],
          "override_allocation_key": "allocation-override-123abc",
          "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
          "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
          "status": "ENABLED"
        }
      ],
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
      "name": "Feature Flag ABC123",
      "staleness_status": "ACTIVE",
      "tags": [],
      "updated_at": "2023-01-01T00:00:00Z",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "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"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "feature-flags"
  }
}