CreateFlagRequestBody

April 11, 2026 ยท View on GitHub

Example Usage

import { CreateFlagRequestBody } from "@vercel/sdk/models/createflagop.js";

let value: CreateFlagRequestBody = {
  slug: "<value>",
  kind: "json",
  environments: {
    "key": {
      active: true,
      pausedOutcome: {
        type: "<value>",
        variantId: "<id>",
      },
      rules: [
        {
          id: "<id>",
          conditions: [
            {
              lhs: {
                type: "<value>",
                kind: "<value>",
                attribute: "<value>",
              },
              cmp: "containsAnyOf",
            },
          ],
          outcome: {
            type: "<value>",
            base: {
              type: "<value>",
              kind: "<value>",
              attribute: "<value>",
            },
            weights: {},
            defaultVariantId: "<id>",
          },
        },
      ],
      fallthrough: {
        type: "<value>",
        base: {
          type: "<value>",
          kind: "<value>",
          attribute: "<value>",
        },
        weights: {
          "key": 21.45,
          "key1": 2447.61,
        },
        defaultVariantId: "<id>",
      },
    },
  },
};

Fields

FieldTypeRequiredDescription
slugstring:heavy_check_mark:A unique (per project) key for the flag, composed of letters, numbers, dashes, and underscores
kindmodels.CreateFlagKind:heavy_check_mark:The kind of flag
variantsmodels.CreateFlagVariants[]:heavy_minus_sign:The variants of the flag
environmentsRecord<string, models.CreateFlagEnvironments>:heavy_check_mark:The configuration for the flag in different environments
seednumber:heavy_minus_sign:A random seed to prevent split points in different flags from having the same targets
descriptionstring:heavy_minus_sign:A description of the flag
statemodels.CreateFlagState:heavy_minus_sign:N/A
maintainerIdsstring[]:heavy_minus_sign:The user ids of the maintainers of the flag
permanentboolean:heavy_minus_sign:Whether this flag is marked as permanent, indicating it should not be removed
tagsstring[]:heavy_minus_sign:Tags for categorizing the flag